Issues with Firefox / Gecko driver (Nov 2016)

I use protractor for automation. There have been issues with webdriver 2.x with FF 48.x and up. protractor does not yet support gecko driver.

I did  workaround mentioned here to enable firefox using gecko driver working with protractor.

This worked well but there are still many feature that are not implemented in gecko driver and seems like they are work in progress.

Here are couple that troubled me and their workaround.

Note: I defined a global variable (say BrowserType) that gets populated with the actual browser type using below code. This variable was used by code to decide when to use firefox specific workaround.

return browser.getCapabilities().then(function (cap){
    return  cap.get('browserName');
});

1. action builder:

Ex:

browser.actions().mouseMove(element).perform();

Errors:

POST /session/22243008-f8f8-4b66-b6b4-bd395994f8db/moveto did not match a known command

Suggested solution:

If you are using similar code to view a dropdown, please don’t spend any more time to solve it. It’s not yet implemented. Use javascript to directly click on the element that is supposed to be shown by mouse over.

Example:

browser.executeScript("arguments[0].click();", element);

2. Getting a attribute value from edit box

Ex:

 element.getAttribute('value');

Errors:

NULL value is returned instead of actual value

Suggested solution:

I could not make it work and finally I had to go back to direct javascript executor to solve this.

Example:

 browser.executeScript("return arguments[0].value", element);

If I hit more blocking issues, I’ll come back and update this page.
By the way,  Selenium 3.x beta is available and works well with webdriver. Though it did not work for me with protractor . If selenium 3.x has worked for you , that may be better option to use instead of above combination.

Advertisements