How to use the selenium-webdriver.Builder function in selenium-webdriver

To help you get started, we’ve selected a few selenium-webdriver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scrollback / scrollback / test / ui-automation-test / webdriver.js View on Github external
function runTests(caps) {
	var driver = new webdriver.Builder().usingServer(url).withCapabilities(caps).build();
	var roomname = ''
	
	
	/*
	Checking if the socket connection is established correctly and existing messages are loaded without errors (this is done by initializing the DB with some initial test data).
Sending a message as a guest user.
 Logging in (assertion for a nick change here).
 Sending a message as a logged in user.
 Logging out.
 Changing the user nick.
 Test to check if plug ins are working correctly : (Banned words, Repetitive messages) 
 Logging in from archive view. 
 Logging out from archive view.
 Sending a message from archive view (This test case is currently not working).
	*/
	// Load a nonexistent scrollback room
github chenglou / node-huxley / tests / index.js View on Github external
function _testInjectedDriver(browserName, serverUrl, next) {
  var webdriver = require('selenium-webdriver');
  var browser = webdriver.Capabilities.firefox();
  var driver = new webdriver.Builder()
    .usingServer(serverUrl)
    .withCapabilities(browser)
    .build();

  huxley.injectDriver(function() {
    return driver;
  });

  _testPasses(browserName, serverUrl, function(err) {
    if (err) return next(false);

    next();
    // Erase the injected driver. Just for sure, that we didn't broke next test.
    huxley.injectDriver(null);
  });
}
github apifytech / apify-js / src / webdriver.js View on Github external
this.chromeOptions.addArguments('--disable-translate');
        this.chromeOptions.addArguments('--safebrowsing-disable-auto-update');
        if (this.options.headless) {
            this.chromeOptions.addArguments('--headless', '--no-sandbox');
            if (isWin) {
                // Temporarily needed on Windows
                this.chromeOptions.addArguments('--disable-gpu');
            }
        }
        this.chromeOptions.addArguments(`--user-agent=${this.options.userAgent || DEFAULT_USER_AGENT}`);

        if (this.options.extraChromeArguments) {
            this.chromeOptions.addArguments(this.options.extraChromeArguments);
        }

        this.builder = new Builder();

        // Instance of Selenium's WebDriver
        this.webDriver = null;
    }
github authelia / authelia / test / helpers / context / WithDriver.ts View on Github external
export async function StartDriver(proxy?: ProxyConfig) {
  let options = new chrome.Options();

  if (process.env['HEADLESS'] == 'y') {
    options = options.headless();
  }

  let driverBuilder = new SeleniumWebdriver.Builder()
    .forBrowser("chrome");

  if (proxy) {
    options = options.addArguments(`--proxy-server=${proxy.httpProxy}`)
  }

  driverBuilder = driverBuilder.setChromeOptions(options);
  return await driverBuilder.build();
}
github tidepool-org / blip / test / lib / saucelabs.js View on Github external
createNewDriver: function() {
    var caps = this._getCapabilities();
    var hubUrl = this._getHubUrl();

    var driver = new webdriver.Builder().
      withCapabilities(caps).
      usingServer(hubUrl).
      build();

    return driver;
  },
github opentrials / opentrials / test / e2e / contribute-data.js View on Github external
before(() => {
    SERVER_URL = getServerUrl();
    driver = new webdriver.Builder()
      .withCapabilities(webdriver.Capabilities.firefox())
      .build();
  });
github microsoft / devops-project-samples / node / express / webappWithTests / Tests / functional_tests / sampleFunctionalTests.js View on Github external
before(async () => {
		driver = new webdriver.Builder()
			.forBrowser('chrome')
			.withCapabilities(capabilities)
			.build();
			await driver.manage().setTimeouts({pageLoad: 120000});
	})
github KanoComputing / make-art / selenium-webdriver / driverSetup.js View on Github external
function driver() {
    const driver_builder = new Builder()
        .forBrowser('chrome')
        .setChromeOptions(chrome_options);

    return driver_builder.build();
}
github mmendesas / walnutjs / src / support / world.js View on Github external
function getDriverInstance() {
  const driver = new webdriver.Builder()
    .usingServer(config.selenium.remoteURL)
    .withCapabilities(config.selenium.caps)
    .build();

  return driver;
}
github influxdata / influxdb / e2e / cucumber.js View on Github external
caps.set('applicationCacheEnabled', false);

    switch (__config.browser.toLowerCase()) {
        case "chrome":
        global.__wdriver = new Builder()
            .withCapabilities(caps)
            .forBrowser(__config.browser)
            .setChromeOptions(new chrome.Options().headless()
            .addArguments(chromeArguments)
                .setUserPreferences(chromeUserPreferences)
                .setLoggingPrefs(logPrefs)
                .windowSize({width: windowSize.width, height: windowSize.height}))
            .build();
            break;
        case "firefox":
            global.__wdriver = new Builder()
                .forBrowser(__config.browser)
                .setFirefoxOptions(new ffox.Options().headless().windowSize({width: windowSize.width,
                    height: windowSize.height}))
                .build();
            break;

    }
}else{
    switch (__config.browser.toLowerCase()) {
        case "chrome":
            global.__wdriver = new Builder()
                .withCapabilities(caps)
                .forBrowser(__config.browser)
                .setChromeOptions(new chrome.Options().addArguments("--incognito")
                    .addArguments(chromeArguments)
                    .setUserPreferences(chromeUserPreferences)