Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to reload the html DOM with selenium so that the new commands will locate the new nodes?

So I'm doing some tests one a page that changes it's html tree after clicking certain buttons and links. but the webdriver keeps searching only through the old html DOM.

So how can I target the newly added webelements? or how can I make the webdriver load the new Html DOM so that it target the new elements? thanks

like image 999
roni1800 Avatar asked Dec 13 '15 13:12

roni1800


1 Answers

WebDriver does poll the DOM automatically.

Just use implicit or explicit wait before interaction with recently added web elements: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#explicit-and-implicit-waits

like image 90
drets Avatar answered Sep 30 '22 19:09

drets