I have downloaded the latest version of Firefox ie Quantum. For Selenium,earlier there was no need of downloading any executable for Firefox to open an URL but now it throws an error of setting property for GeckoDriver.
So, I downloaded the latest version of geckodriver-v0.20.1-arm7hf.tar.gz and put that in System.setProperty()
so it has thrown an error of connection refusal.
So, I used the alternative for opening the URL on Chrome. Downloaded chromeExecutable and was able to open without any connection refusal.
Code snippet:-
System.setProperty("webdriver.gecko.driver", "C:\\XYZ\\XXXX\\Downloads\\geckodriver-v0.20.1-arm7hf.tar.gz");
WebDriver driver=new FirefoxDriver();
driver.get("https://google.com");
Console Error:
Caused by: java.net.ConnectException: Connection refused: connect
Can anyone please help to figure out the issue on Mozilla Firefox?
Thanks
Mehak
There aren't a lot of infos in your question, but I guess the following is an issue:
In
System.setProperty("webdriver.gecko.driver", "C:\XYZ\XXXX\Downloads\geckodriver-v0.20.1-arm7hf.tar.gz");
seems you are under a Windows OS (analyzing the path) but you are setting geckodriver-v0.20.1-arm7hf.tar.gz.
If you have a windows os, you should:
- Download from here the related version (geckodriver-v0.20.1-win64.zip or geckodriver-v0.20.1-win32.zip, it depends on your OS)
- Extract it and set, in the System.setProperty, the path to the extracted geckodriver.exe
Something like that:
System.setProperty("webdriver.gecko.driver",
"C:\XYZ\XXXX\Downloads\geckodriver.exe");
If you are under another os, you should download the proper asset and do basically the same thing. If you hava a linux/mac os, you have to be sure that the extracted geckodriver is executable.
As per the Best Practices you need to follow the points below:
As you are on Windows OS download either geckodriver-v0.20.1-win32.zip or geckodriver-v0.20.1-win64.zip and unzip for your usage.