Waits
目前大部分Web应用都使用的是AJAX技术。当一个页面被加载到浏览器时,这个页面的元素可能在不同时间段进行加载。 如果元素不存在与DOM中,将很难被定位到并将会报出
ElementNotVisibleException 异常。我们可以使用waits来解决这个问题。Waiting 操作执行之间提供了时间的间隔。
Selenium Webdriver 提供了两种 waits:implicit & explicit.
Explicit Waits(显示等待)
定义一个等待的条件,当到达这个条件后,结束等待。

Expected Conditions
- title_is
- title_contains
- presence_of_element_located
- visibility_of_element_located
- visibility_of
- presence_of_all_elements_located
- text_to_be_present_in_element
- text_to_be_present_in_element_value
- frame_to_be_available_and_switch_to_it
- invisibility_of_element_located
- element_to_be_clickable - it is Displayed and Enabled.
- staleness_of
- element_to_be_selected
- element_located_to_be_selected
- element_selection_state_to_be
- element_located_selection_state_to_be
- alert_is_present

Implicit Waits(隐式等待)
定义一个等待的时间。默认值为0s.

5. Waits,布布扣,bubuko.com
5. Waits
原文:http://www.cnblogs.com/hugh007/p/3853598.html