摘要: 在进行web自动化的时候,受页面加载速度影响比较大,常常会报element not found的错误。selenium1.0 中提供了selenium.isElementPresent(Xpath),用于判断xpath是否存在,存在就执行操作,不存在就可以等待一定的时间段。在webDriver中提供了WebDriverWait类,可以智能的等待页面元素加载完成再执行操作。核心函数如下: def until(self, method): """Calls the method provided with the driver as an argument until 阅读全文
posted @ 2012-02-24 14:28 大虫子 阅读(1339) 评论(0) 推荐(0)