Reputation: 979
Sometimes clicks do not work in Firefox or Chrome when I am using nightwatch. I have the following code
browser
.waitForElementVisible('.example')
.click('.example')
.waitForElementVisible('body')
The problem is the click event doesn't fire. Does anyone know why clicks sometimes do not work when using nightwatch.js and what you should do to accomodate this?
Upvotes: 1
Views: 1015
Reputation: 1
.waitForElementVisible('.example')
waitForElemenVisible
accepts a minimum of 3 arguments. Please see the following snippet for an example of the correct usage
.waitForElementVisible('.example',5000,false)
Upvotes: 0
Reputation: 2244
I was looking for an answer to this as well and the only solution seems to be to use an older version of Firefox and a compatible driver.
Here is the message that Selenium offers when you attempt to create a new issue on their github issue tracker:
"Since Firefox version 48, Mozilla requires all add-ons to be signed. Until recently, Firefox support in Selenium was exclusively provided by an add-on. As this add-on is not currently signed, this solution does not work with the latest Firefox releases. As an alternative, Mozilla are working on a WebDriver specification compliant implementation named GeckoDriver. Please note that the specification is not complete, and that Selenium itself does not comply with the specification at this time. This means that features previously available through Selenium will not be available using GeckoDriver."
Upvotes: 0
Reputation: 174
I guess, you should specify the time period in the function waitForElementVisible('body', 1000). Update the code with this and see you are able to resolve the issue
For syntax and example for waitElementVisible() see here
Upvotes: 2