期望状态与 显示等待 一起使用. 与其定义要使用 lambda 执行的代码块, 不如使用 lambda 执行可以创建 Conditions 方法来表示等待的常见事物. 有些方法将定位器作为参数, 有些方法将元素作为参数.

这些方法可以包括以下条件:

    wait = WebDriverWait(driver, timeout=2)
    wait.until(EC.visibility_of_element_located((By.ID, "revealed")))
.NET stopped supporting Expected Conditions in Selenium 4 to minimize maintenance hassle and redundancy.
Ruby makes frequent use of blocks, procs and lambdas and does not need Expected Conditions classes