0

Is there any possibility to set up proxy for selenide library?

I start autotests from command line with maven comman:

mvn clean test [some params] site

It was possible to change maven setting to use proxy (in ${maven.home}/conf/settings.xml) so it can download dependencies.

But one of dependencies is which requests http://chromedriver.storage.googleapis.com/ to check/download last version of chromedriver.exe. And here I've got an error:

java.net.UnknownHostException: chromedriver.storage.googleapis.com

io.github.bonigarcia.wdm.WebDriverManagerException: java.net.UnknownHostException: chromedriver.storage.googleapis.com
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:475)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:458)
    at io.github.bonigarcia.wdm.WebDriverManager.handleException(WebDriverManager.java:472)
    at io.github.bonigarcia.wdm.WebDriverManager.manage(WebDriverManager.java:458)
    at io.github.bonigarcia.wdm.WebDriverManager.setup(WebDriverManager.java:219)
    at com.codeborne.selenide.webdriver.WebDriverBinaryManager.setupBinaryPath(WebDriverBinaryManager.java:16)
    at com.codeborne.selenide.webdriver.WebDriverFactory.createWebDriver(WebDriverFactory.java:55)
    at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.createDriver(WebDriverThreadLocalContainer.java:231)
    at com.codeborne.selenide.impl.WebDriverThreadLocalContainer.getAndCheckWebDriver(WebDriverThreadLocalContainer.java:118)
    at com.codeborne.selenide.WebDriverRunner.getAndCheckWebDriver(WebDriverRunner.java:136)
    at com.codeborne.selenide.impl.Navigator.navigateToAbsoluteUrl(Navigator.java:68)
    at com.codeborne.selenide.impl.Navigator.open(Navigator.java:32)
    at com.codeborne.selenide.Selenide.open(Selenide.java:95)
    at com.codeborne.selenide.Selenide.open(Selenide.java:69)

UPDATE:

If the network is not available, but there is already any previously downloaded version of chromedriver, this version would be used:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
[main] WARN io.github.bonigarcia.wdm.WebDriverManager - Network not available. F
orcing the use of cache
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Found chromedriver in ca
che: C:\Users\XUser\.m2\repository\webdriver\chromedriver\win32\2.38\chr
omedriver.exe
[main] INFO io.github.bonigarcia.wdm.WebDriverManager - Exporting webdriver.chro
me.driver as C:\Users\XUser\.m2\repository\webdriver\chromedriver\win32\
2.38\chromedriver.exe
1

I guess it's not possible now. Could you register a github issue at https://github.com/codeborne/selenide?

By the way, you can just disable automatic downloading of webdriver in Selenide:

Configuration.driverManagerEnabled = false;

1

There is a system property to set proxy for web driver manager:

System.setProperty("wdm.proxy", url);    // url as "http://host:port"
System.setProperty("wdm.proxyUser", url);
System.setProperty("wdm.proxyPass", url);

More info https://github.com/bonigarcia/webdrivermanager#configuration

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.