问题
There are multiple dropdowns in div section. If i select an option in one of the dropdown, then all the other dropdowns loads autmatically without page reload. This is because of only that particular section reloads. Sometimes this loads fast and sometimes slow. How can we set webdriver to wait until this div section reload fully.
<div id="Fruits">
...
...
</div>
Am using C# Thank you
回答1:
We can wait until div
section have any sub section or child node.
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(30));
IWebElement myDynamicElement = wait.Until<IWebElement>((d) =>
{
return d.FindElement(By.XPath("//div[@id='Fruits']//*"));
});
来源:https://stackoverflow.com/questions/63084609/how-to-wait-until-div-section-reload-using-selenium-webdriver