NoSuchElementException comes often even if the element exists.

55 views
Skip to first unread message

navpreet singh

unread,
Sep 1, 2015, 2:21:21 AM9/1/15
to Selenium Users
I have observed that sometimes, Selenium is not able to find the element even after it is displayed on the webpage. The same case when run multiple times shows different results i.e. Sometimes the element is found and execution for further scenarios works fine but some times , NoSuchElementFoundException comes and the test cases fails. How can we deal with such inconsistency of the behavior observed.

peterlck

unread,
Sep 1, 2015, 2:33:06 PM9/1/15
to Selenium Users
You should use something like this to continuously interact with the element but make sure the element exist.
http://sqa.stackexchange.com/questions/9636/using-fluentwait-class-to-wait-until-a-condition-is-true-in-selenium-webdriver
Reply all
Reply to author
Forward
0 new messages