From the course: Test Automation with Selenium WebDriver for Java
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Solution: Wait for appearance
From the course: Test Automation with Selenium WebDriver for Java
Solution: Wait for appearance
(uptempo music) - [Instructor] On the dynamically modified page, I find the element that is going to be removed. Then I click the button that will remove that element from the DOM. The page says that the element will be removed in half a second, which is 5,000 milliseconds. So I construct an explicit weight that will weight 5,001 milliseconds, leaving a little room for the action to complete. I then use that weight to specify the condition to wait for, which is the invisibility of the element. This call returns a Boolean value, so I print that out just to make sure that it's true.