Closed patrickelectric closed 6 months ago
If you're waiting for the element to become visible you can do something like this:
let elem = driver.query(By::Id("button1")).first().await?;
// Wait until the element is displayed.
elem.wait_until().displayed().await?;
From the example at https://docs.rs/thirtyfour/latest/thirtyfour/extensions/query/struct.ElementWaiter.html
If the button doesn't even exist on the page but you want to wait for it to show up, this is the default behaviour when using the ElementQuery
trait. See https://docs.rs/thirtyfour/latest/thirtyfour/extensions/query/struct.ElementQuery.html
Thnaks @stevepryde!
I have a dynamic page that I don't know how long will it take to show the button, sometimes is 1 second, sometimes 4 seconds. I don't want to wait forever each time for me to click. Is there a way to wait for it without a loop ?