Issue
How do I wait for a < ul > element to change because of an < input > search, given that if there are no results the < ul > is hidden?
- I have tried implicitWait and pageLoad methods, but those don’t work in this case, since what I need is an element specific wait (the page and its elements already loaded).
- Also, waiting for the specific
<ul>
element to show up is useless as well, since it is already present before I type the search. - I also can’t use as criteria the resulting
<li>
elements to verify the search , for mainly two reasons: that is what I am verifying on the next step of the test; javascript hides the<ul>
if there are no results for that search.
What I need is some kind of method that waits for the <ul>
to refresh/change, but I am not sure if that exists or even makes sense.
Thanks in advance!
Solution
I solved this shortly after I posted but I just remembered to give give the answer later, for those interested. There was an element (a spinner) that appeared while the search (the ul) was loading, and by freezing the page using dev tools, I managed to locate that spinner element. Then I only had to wait for it to disappear using SeleniumExtras.WaitHelpers.ExpectedConditions. Thanks for the help anyways!
Answered By – JPCF
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0