Test fails when isVisible is called on a non visible element
See original GitHub issueConsider the following code:
client.isVisible('.my-class', result => {
if (result.value === true) {/*do something*/}
else {/*do something else*/}
}
If the element is visible everything works great. However, if the element is not visible the test fails with an error:
ERROR: Unable to locate element: ".my-class" using: css selector
I believe that isVisible should just return the result and never fail the test.
[Nightwatch version 0.9.5; reproduced w/ Appium over iOS and Selenium over Chrome.]
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Debug the Element Visibility Problems in Cypress
Cypress fails the test when the clearly visible "Cypress is amazing!" element is deemed NOT ... Call isVisible and pass the selected element....
Read more >Check if element is visible in Playwright - Stack Overflow
Here are two ways to check element is NOT visible (check waitForSelector options): await page.waitForSelector('.btn', { state: 'detached' });.
Read more >waitForElementVisible() produces false fails - Bugs Report
I've noticed that this method is producing a Pass even when the element cannot be found. I do see that it stops the...
Read more >isVisible | API Reference - Nightwatch.js
If the element is not found, an error is thrown which will cause the test to fail. You can suppress element not found...
Read more >Check Visibility of Web Elements Using Various Types ...
Like isDisplayed() method, it is designed to result in a Boolean value with each success and failure. The method returns a “true” value...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I found a workaround in the mailing list if anyone has this issue.
@senocular Thanks!