Recently I upgraded to Selenium 3.7.
Code:
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public static
I tried with the same versions without any problem.
If the path to the geckodriver:
System.setProperty("webdriver.gecko.driver",
"/usr/local/bin/geckodriver");
is correct, make sure that the geckodriver is executable for the user that execute the code:
chmod +x geckodriver
After doing some research, I manage to resolve this problem.
The error is due to the 127.0.0.1 map to localhost.com in etc/hosts. Edited: 127.0.0.1 localhost
I think you are missing the .exe extension. Your path should be like this
System.setProperty("webdriver.gecko.driver",
"/usr/local/bin/geckodriver.exe");
The error WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8970
can occur due to different reasons.
More over there is a discrepency in your Included Library
list as selenium-server-standalone-3.7.1.jar
is never a part of downloaded selenium-java-3.7.1.zip
.
Try out the steps mentioned below:
Included Library
list remove all the jars
.Download
and Add
only selenium-server-standalone-3.7.1.jar
from this link or from this linkEnsure that /etc/hosts
on your system contains the following entry :
1 127.0.0.1 localhost.localdomain localhost
Run CCleaner
Tool to wipe away all the OS
chores from your system.
System Reboot
.Test
.