isDisplayed Error: No element found using locator instead of boolean

0 votes

I have a method isElementDisplayed with element.isDisplayed call inside.

It is throwing No element found exception

isElementDisplayed(element: ElementFinder) {

    return element.isDisplayed();

}
Jul 18, 2018 in Selenium by Martin
• 4,220 points
93 views

1 answer to this question.

0 votes

You should check whether an element is present in the DOM or not.

Use isElementPresent() or isPresent(): because isDisplayed() will check that an element is visible or not.

expect(browser.isElementPresent(element(by.id('ELEMENT_ID_HERE')))).toBe(false);

expect(element(by.id('ELEMENT_ID_HERE')).isPresent()).toBe(false);

answered Jul 18, 2018 by Samarpit
• 5,130 points

Related Questions In Selenium

0 votes
1 answer

Selenium XPath error:- Element not found

The reason for Element not found exception ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,090 points
3,039 views
0 votes
1 answer

Is it possible to manually set the attribute value of a Web Element using Selenium?

Yes, its very much possible. You just ...READ MORE

answered May 8, 2018 in Selenium by king_kenny
• 3,650 points
5,500 views
0 votes
1 answer

Get coordinates or dimensions of element with Python using Selenium WebDriver

WebElements have the properties such as .size and .location. ...READ MORE

answered Jul 11, 2018 in Selenium by Meci Matt
• 9,420 points
1,703 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
542 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
877 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
535 views
0 votes
1 answer
0 votes
1 answer

How to get next sibling element using XPath and Selenium for Java?

Below code will help you: Try following-sibling axis : WebElement ...READ MORE

answered May 15, 2018 in Selenium by Samarpit
• 5,130 points
5,435 views