首页 > Web开发 > 详细

WebDriverWait

时间:2014-09-27 15:44:41      阅读:315      评论:0      收藏:0      [点我收藏+]

WebDriverWait(self, driver, timeout).until(self, method,message=‘ ‘)

def until(self, method, message=‘‘):
"""Calls the method provided with the driver as an argument until the \
return value is not False."""
end_time = time.time() + self._timeout
while(True):
try:
value = method(self._driver)
if value:
return value
except self._ignored_exceptions:
pass
time.sleep(self._poll)
if(time.time() > end_time):
break
raise TimeoutException(message)

 

WebDriverWait(driver, 10).until(lambda s: not self.is_element_present((By.ID, ‘delete-me’)))

WebDriverWait

原文:http://www.cnblogs.com/cfeng/p/3996363.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!