After hours of searching the internet in vain, I have yet to find a solution. My current challenge involves testing my app on older versions of Firefox (specifically v41.0) for certain reasons. To facilitate this, I am utilizing a Selenium docker image for the hub (v3.4.0) and another docker image for the Firefox node (v41.0).
I am aware that Geckodriver is not compatible with older versions of Firefox, but it seems a possible workaround is using:
{ "marionette": true }
The Firefox node successfully connects to the grid. I can access it using
docker exec -it <container-id> bash
, but issues arise when running the test.
Despite ongoing efforts, I am currently stuck. Here is the Dockerfile code for the Firefox node: [link] and here is the test code (using MochaJS).
test.it("should redirect to Google with FIREFOX 41.0", () => {
var firefoxCap = Capabilities.firefox();
firefoxCap.set('marionette', true);
driver = new webdriver.Builder()
.usingServer(CONSTANTS.SELENIUM_HUB)
.withCapabilities(firefoxCap)
.build();
driver.get(CONSTANTS.GOOGLE_URL);
driver.wait(until.titleIs(CONSTANTS.GOOGLE_TITLE));
driver.wait(until.elementLocated(By.name(CONSTANTS.GOOGLE_SEARCH_KEY))).sendKeys(CONSTANTS.GOOGLE_SEARCH_VALUE);
driver.findElement(By.name(CONSTANTS.GOOGLE_SEARCH_BUTTON_NAME)).click();
driver.wait(until.titleIs(CONSTANTS.GOOGLE_SEARCH_TITLE));
driver.wait(until.elementLocated(By.tagName(CONSTANTS.GOOGLE_RES_LINK))).click();
driver.wait(until.titleIs(CONSTANTS.GOOGLE_TITLE));
driver.quit();
});
Here are the logs:
~/dev/selenium-grids/src$ mocha --timeout 30000 tests.js
Starting the tests...
Work with REMOTE URL
1) should redirect to Google with FIREFOX 41.0
0 passing (6s)
1 failing
1) Work with REMOTE URL should redirect to Google with FIREFOX 41.0:
WebDriverError: Missing 'marionetteProtocol' field in handshake
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'd4b3266d29f4', ip: '172.17.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-87-generic', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
(remaining stacktrace omitted)
Closing the tests
When searching for solutions to the issue - because "Google is your friend" - the responses suggest either updating Firefox or downgrading Selenium versions, neither of which are viable options for me. Can anyone provide guidance on how to resolve this? Even a temporary workaround would be greatly appreciated.
Thank you