Home > Blockchain >  Selenium tests error in Firefox when setting Host property to ::1 (geckodriver)
Selenium tests error in Firefox when setting Host property to ::1 (geckodriver)

Time:11-02

I am trying to set Firefox to use IPv6 as opposed to the default IPv4 because it runs extremely slowly compared with Chrome. I have followed the instructions on the following threads:

Firefox Webdriver is extremely slow

Selenium geckodriver executes findElement 10 times slower than chromedriver (.Net)

My code looks like this:

                FirefoxOptions firefox = new FirefoxOptions();
                FirefoxDriverService service = FirefoxDriverService.CreateDefaultService();
                service.Host = "::1";
                firefox.AddArgument("-headless");
                return new FirefoxDriver(service, firefox);

I have also tried passing in the geckodriver location like this:

                FirefoxDriverService service = FirefoxDriverService.CreateDefaultService(LocalConfig.Root   "bin\\Debug", "geckodriver.exe");

The error I get is the following:

OpenQA.Selenium.WebDriverException : Cannot start the driver service on http://localhost:50171/

If I set service.Host to be an empty string, the tests will run without any errors.

If I pass it a load of random characters, it'll produce the same error as above, leading me to wonder if it even recognises the ::1 string.

Am I missing something obvious here? Thanks

CodePudding user response:

Turned out to be a new bug. It's being looked at in the following places if anyone else is experiencing the same problem:

https://bugzilla.mozilla.org/show_bug.cgi?id=1732622

https://github.com/mozilla/geckodriver/issues/1936

https://github.com/mozilla/geckodriver/issues/1935

  • Related