Skip to content Skip to sidebar Skip to footer

Selenium Python: Can Not Connect To The Service %s" % Self.path

I am trying to run a selenium test with python script, but I am receiving the following error when executing the test: Traceback (most recent call last): File '/var/www/html/seleni

Solution 1:

After googling for a while, and trying various solutions. I found the one that worked for me at here: https://github.com/SeleniumHQ/selenium/issues/2903#issuecomment-272112510

As mentioned in that comment, try to add 127.0.0.1 localhost to /etc/hosts

Solution 2:

For MAC System: Change the host file to default as below: 1. Command+Shift+G go to /private/etc/hosts 2.Open in Text File 3. File > Save as and uncheck the box for “If no extension is provided use txt” and rename hosts 4.Go Terminal execute command cat /etc/hosts Check if it shows

##### Host Database## localhost is used to configure the loopback interface# when the system is booting. Do not change this entry.##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1 localhostfe80::1%lo0 localhost

Solution 3:

For windows C:\Windows\System32\drivers\etc\hosts

Open as Administrator a Notepad then open the file hosts and do all the changes you need, in my particular case was:

0.0.0.0            localhost

to:

127.0.0.1 localhost

that fixed my problem with Selenium.

Post a Comment for "Selenium Python: Can Not Connect To The Service %s" % Self.path"