Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

Inconsistent variable names in sauce.js and driverProvider.js, config_.webDriverProxy needs to be added to sauce.js file #3694

@zamani16

Description

@zamani16

It seems that webDriverProxy variable is missing in the 'sauce.js' file! Therefore, we have the following workaround in place to have our Protractor test run on Sauce Labs via our corporate proxy:

  1. In protractor config.js add following lines
exports.config = { 
     sauceUser:'SauceUser',
     sauceKey:'SauceKey',
     webDriverProxy: 'http://proxy.mysite.com:18099',

   // things you had in there before
};
  1. In node_modules/protractor/lib/driverProviders/sauce.js file (i.e. the DriverProvider for Sauce Labs in Protractor), add this:
this.sauceServer_ = new SauceLabs({
    username: this.config_.sauceUser,
    password: this.config_.sauceKey,
    agent: this.config_.sauceAgent,
    proxy: this.config_.webDriverProxy   // this line needs to be added
});
  1. In node_modules/protractor/lib/driverProviders/driverProvider.js modify the getNewDriver function as below.
DriverProvider.prototype.getNewDriver = function() {
 var newDriver = new webdriver.Builder().
     usingServer(this.config_.seleniumAddress).
  usingWebDriverProxy(this.config_.webDriverProxy).    // here we have webDriverProxy
     withCapabilities(this.config_.capabilities).
     build();
 this.drivers_.push(newDriver);
 return newDriver;
};

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions