"The path to the driver executable must be set by the webdriver.gecko.driver system property"
Why would it all of a sudden start asking for geckodriver if it wasn't needed before? We haven't changed anything on the server or test machines. Test machines are running FF 46.0.1 on Windows 8.1. Trying to get to the bottom, we downloaded geckodriver.exe and copied to the FF directory, also added the directory path to the path environment variable.
Now it throws the following error which we cant get past from:
"Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Build info: version: 'unknown', revision: '31c43c8', time: '2016-08-02 21:57:56 -0700' System info: host: 'JR-win8-64-2', ip: '10.0.0.4', os.name: 'Windows 8.1', os.arch: 'x86', os.version: '6.3', java.version: '1.8.0_65' Driver info: driver.version: FirefoxDriver"
Cant even get the Amazon test project to run as it throws the same error. We have also tried on FF 44 and 48, same results. Any assistance would be greatly appreciated.
Hi,
I also experienced the same problem with my Firefox 46 and I solved it by modifying my ivy.xml
Upon googling, I understood that the latest version of Selenium needs an external .exe called gecko driver to interact with Firefox; this was the case for Selenium with other browsers such as Chrome & IE, but now its required for Firefox as well.
Fortunately, till Selenium 2.53 this was not the case, we can modify our ivy.xml file NOT to download latest version of the selenium like this -
<dependency org="org.seleniumhq.selenium" name="selenium-java" rev="2.53.1"/>
<dependency org="org.seleniumhq.selenium" name="selenium-server" rev="2.53.1"/>
<dependency org="org.seleniumhq.selenium" name="selenium-firefox-driver" rev="2.53.1"/>
NOTE:
1. This will only work with Firefox version still 46 and not beyond that.
2. I know the above solution is not an ideal one but solves the problem temporarily. The ideal solution would be to modify "Browser.groovy" script under Selenium source code in RedwoodHQ to pick up the gecko driver for Firefox. I am working on it and will post it once I find a solution.
Thanks for your help! This got us moving again.
<dependency org="org.seleniumhq.selenium" name="selenium-support" rev="latest.release"/>
if (params."Browser Type" == "Firefox"){
if(os.contains("nix") || os.contains("nux")|| os.contains("aix")){ //tested on Linux Mint
System.setProperty("webdriver.gecko.driver", "geckodriverLinux64v0_15_0")
new File("geckodriverLinux64v0_15_0").setExecutable(true)
FirefoxBinary binary = new FirefoxBinary(new File("/usr/bin/firefox"))
FirefoxProfile profile = new FirefoxProfile()
Driver = new FirefoxDriver(binary, profile)
} else if(os.contains("mac")){ //tested on macOS 10.12.3
System.setProperty("webdriver.gecko.driver", "geckodriverMacv0_15_0")
new File("geckodriverMacv0_15_0").setExecutable(true)
FirefoxBinary binary = new FirefoxBinary(new File("/Applications/Firefox.app/Contents/MacOS/firefox"))
FirefoxProfile profile = new FirefoxProfile()
Driver = new FirefoxDriver(binary, profile)
} else {
String arch = System.getenv("PROCESSOR_ARCHITECTURE");
String wow64Arch = System.getenv("PROCESSOR_ARCHITEW6432");
String realArch = arch.endsWith("64") || wow64Arch != null && wow64Arch.endsWith("64") ? "64" : "32"; //this is where the magic happens
if (realArch.contains("32")) { //tested on Windows 10 32-bit
System.setProperty("webdriver.gecko.driver", "geckodriver32v0_15_0.exe")
FirefoxBinary binary = new FirefoxBinary(new File("C:/Program Files/Mozilla Firefox/firefox.exe"))
} else { //tested on Windows 2012 64-bit
System.setProperty("webdriver.gecko.driver", "geckodriver64v0_15_0.exe")
FirefoxBinary binary = new FirefoxBinary(new File("C:/Program Files (x86)/Mozilla Firefox/firefox.exe"))
}
FirefoxProfile profile = new FirefoxProfile()
Driver = new FirefoxDriver(binary, profile)
}
}