本帖最后由 adolf186 于 2016-12-19 16:26 编辑
- def findElement(driver,id): if (driver.find_elements_by_id(id).is_displayed()): driver.find_elements_by_id(id).click else: driver.find_element_by_id('com.tuniu.app.ui:id/iv_style3_card_1').clickfindElement(driver, 'android:id/button1')
复制代码
报错信息:Traceback (most recent call last): findElement(driver, 'android:id/button1') if (driver.find_elements_by_id(id).is_displayed()): AttributeError: 'list' object has no attribute 'is_displayed' 我的疑问是,判断机制貌似没有生效,找了那个不存在的id后抛了异常, 对于python,我知之不多,希望懂的朋友帮我看看如何修改。
|