等待页面上的元素加载完成
WebDriverWait wait = new WebDriverWait(this.driver, TimeSpan.FromSeconds(600));
wait.Until(d => d.FindElement(By.CssSelector("table[class='crosstabTable_NS'] td[class='ov DataCell']")));
等待js脚本执行完毕
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
//等待页面上的元素加载完成
var a = wait.Until((d) =>
{
try
{
return this.driver.ExecuteScript(js);
}
catch (Exception ex)
{
return null;
}
});