0

io.github.bonigarcia.wdm.config.WebDriverManagerException: io.github.bonigarcia.wdm.config.WebDriverManagerException: org.apache.hc.client5.http.HttpHostConnectException: Connect to https://chromedriver.storage.googleapis.com:443

Although I am getting this error only when I am using Webdriver manager, if I replace the code:

ChromeOptions chromeOptions = new ChromeOptions();
WebDriverManager.chromedriver().setup();
WebDriver driver = new ChromeDriver(chromeOptions);

with

System.setProperty("webdriver.chrome.driver", pathToDriver)

it then works fine, I am currently using version:

  <!-- https://mvnrepository.com/artifact/io.github.bonigarcia/webdrivermanager -->
        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>5.4.1</version>
        </dependency>

and I've tried with other versions as well, but nothing worked for me.

Updating the issue after BernardV comment. I am currently using version 4.10.0 in Selenium. and I tried to run directly without using webdriver manager, and below is the error I got now:

org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*], extensions: []}}

code I've wrriten is:

@Test
public void testBrowser() {
    //ChromeOptions chromeOptions = new ChromeOptions();
    WebDriver driver = new ChromeDriver();
    driver.get(https://www.google.com);
}
James Z
  • 12,209
  • 10
  • 24
  • 44
Sanat
  • 267
  • 1
  • 5
  • 16
  • Are you running Selenium 4? With the latest version of Selenium 4 (or since Selenium 4.6) you no longer need to use third party apps like this, you can just let Selenium manage it for you automatically. https://www.selenium.dev/documentation/selenium_manager/ – BernardV Jul 25 '23 at 13:35
  • @BernardV Thanks for the suggestion, I tried it, but now I am getting another issue, I've updated the issue accordingly. please check – Sanat Jul 25 '23 at 14:09
  • Sanat do you have some strange way of connecting to the internet like through a proxy etc? Some organistation might also block this from working. It might be that when you try and start the test and Selenium tries to go an get the latest driver it cannot access what it needs to and fails. – BernardV Jul 26 '23 at 06:50
  • @BernardV It is true that I am using my organisation laptop, and there could be some strange way of connecting to the internet, which I am not aware of, but since I am able to run the selenium script through chromedriver.exe. and I also can add chromedriver in my local/temp folder manually, then what could be the issue? I read somewhere that Webdriver manager adds the chromedriver to the local/temp folder, where I can see one folder is present but no exe is present. – Sanat Jul 27 '23 at 21:02

0 Answers0