0

i've created browser instance using watir like below:

proxies = ['--proxy-server=hostname:portnumber', '--proxy-auth=username:password']
browser = Watir::Browser.new :chrome, :switches => proxiesle

but the problem above the code is cannot authenticate proxy by passing parameters --proxy-auth=username:password, i was wondering how could i automatically set username and proxy in chrome driver? Some solution was written in java like below:

DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", Arrays.asList("--proxy-server=http://user:password@proxy.com:8080"));
WebDriver driver = new ChromeDriver(capabilities);

how you guys to override proxy authentication inside chrome ?

1 Answers1

0

Chrome has stopped support for URL authentication system for latest Chrome version.

I have a Java code, which will authenticate pop-up:

WebDriverWait wait = new WebDriverWait(driver, 10);      
Alert alert = wait.until(ExpectedConditions.alertIsPresent());     
alert.authenticateUsing(new UserAndPassword(username, password));

Convert this code in Ruby.

halfer
  • 19,824
  • 17
  • 99
  • 186
Shubham Jain
  • 16,610
  • 15
  • 78
  • 125