Is there a universal approach for Selenium to wait till all ajax content has loaded? (not tied to a specific website - so it works for every ajax website)
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You need to wait for Javascript and jQuery to finish loading. Execute Javascript to check if
jQuery.active
is0
anddocument.readyState
iscomplete
, which means the JS and jQuery load is complete.As Mark Collin described in his book "Mastering Selenium Webdriver", use JavascriptExecutor let you figure out whether a website using jQuery has finished making AJAX calls
I don't believe that there is a universal approach out of the box. I typically make a method that does a
.waituntilrowcount(2)
orwaituntilvisible()
that polls an element.