I have a dashboard with several charts. Until a chart is loaded it displays
Loading...
The page is fully loaded, when in all charts Loading...
isn't visible anymore.
Loading...
is one class embeded in all chart divs. Each chart has an id that changes with every reload.
<div id="loadmask-3379-msgTextEl" data-ref="msgTextEl" role="presentation">Loading...</div>
I can easily wait for one element with the line below but don't know how until all have disappeared:
WebDriverWait(driver, 20).until(EC.invisibility_of_element((By.XPATH,"//div[contains(text(),'Loading')]")))
How can I implement in Selenium with Python and on Edge an explicit wait until Loading...
disappeared in all charts?
CodePudding user response:
You can keep trying to find the element until none is found.
CodePudding user response:
To wait for all the loader elements to disappear you can use either of the following locator strategies:
Using
selenium.webdriver.support.expected_conditions.none_of(*expected_conditions)
:WebDriverWait(driver, 20).until(EC.none_of(visibility_of_all_elements_located((By.XPATH,"//div[contains(text(),'Loading')]"))))