4

I've been trying to add arguments to my Chrome Options to use a proxy and to ignore certain URL's.

I've followed the documentation and am trying to run this very simple test:

@Test
public void myTest(){
    ChromeOptions options = new ChromeOptions();
    options.addArguments("--proxy-server=http://XXX.XX.XX.XX:8080");
    options.addArguments("--proxy-bypass-list=http://www.google.com");
    System.setProperty("webdriver.chrome.driver", "C:/drivers/chromeDriver/win/chromedriver.exe");
    ChromeDriver driver = new ChromeDriver(options);
    driver.get("http://www.google.com");
}

}

I've also tried with the variation:

options.addArguments("--proxy-bypass-list=*");

But it won't open the URL, is there something I'm doing wrong?

ChrisG29
  • 1,501
  • 3
  • 25
  • 45

1 Answers1

2

I guess you should use chromedriver.exe instead of eclipse.exe while setting property and make sure you have compatible chromedriver as per current version available in your system.

Here we go :

ChromeOptions options = new ChromeOptions();
options.addArguments("--proxy-server=http://XXX.XX.XX.XX:8080");
options.addArguments("--proxy-bypass-list=https://www.google.com");
System.setProperty("webdriver.chrome.driver", "driver_location\\chromedriver.exe");
ChromeDriver driver = new ChromeDriver(options);
driver.get("https://www.google.com");
NarendraR
  • 7,577
  • 10
  • 44
  • 82
  • That was just a typo (I've edited the original post). The code doesn't work for me, I get a "This site can't be reached" error. When I take out the "options.addArguments" lines of code, then it laucnhes the site without errors. – ChrisG29 Apr 09 '19 at 19:33