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,330 points
376 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,890 points

Related Questions In Selenium

–1 vote
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,510 points
8,090 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,710 points
13,347 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,460 points
4,282 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,510 points
2,933 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,890 points
2,250 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,890 points
2,386 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,890 points
10,684 views