Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selenium has an IPv6 issue when using firefoxdriver

Tags:

c#

selenium

ipv6

I am trying to use Selenium to drive some web tests in Firefox, however when I do this

FirefoxDriver _driver = new FirefoxDriver();

I get this exception

An address incompatible with the requested protocol was used [::1]:7055

This appears to be some sort of IPv6 vs IPv4 issue that selenium is not going to fix. however I need to work around it. Disabling IPv6 on my Ethernet makes no difference. what else can I try?

Cheers

like image 910
Loofer Avatar asked Nov 03 '22 23:11

Loofer


1 Answers

I'm making a few assumptions here, but this looks like an issue I had using Selenium on Windows when connecting to a URL on localhost. The issue may be due to localhost resolving as ::1 instead of 127.0.0.1 on Windows 2008.

If that is the case add the line 127.0.0.1 localhost into C:\Windows\System32\drivers\etc\hosts

like image 127
Rattle Avatar answered Nov 12 '22 18:11

Rattle