c#显示等待

等待页面上的元素加载完成

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;
    }
});
posted @ 2020-11-19 01:45  轩辕吊雷  阅读(731)  评论(0)    收藏  举报