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,320 points
2,154 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,910 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,500 points
20,554 views
+1 vote
2 answers

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

WebDriver driver; JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("document.getElementById('id123').setAttribute('attr', ...READ MORE

answered Sep 4, 2020 in Selenium by Sri
• 3,190 points
27,534 views
0 votes
2 answers

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,500 points
13,767 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,186 views
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,910 points
7,260 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,898 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,910 points
20,853 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP