selenium +Python 测试时报 “Element is not visible”解决方法
2017-01-16 15:14
676 查看
在selenium +Python 进行web测试时报, 下面的语句报“Element is not visible”,但是通过 xpath checker ,xpath的定位路径是正确的。
思路: 会不会是没有设置等待的时间,页面还没有来的及显示,在该语句前加上等待3秒
实验: 加了时间等待,没有“Element is not visible”
解决方法:加等待时间就可以了
driver.find_element_by_xpath("//div[@id='map-setting-install-3']/div/div/label/div/div/label[2]").click()
思路: 会不会是没有设置等待的时间,页面还没有来的及显示,在该语句前加上等待3秒
实验: 加了时间等待,没有“Element is not visible”
解决方法:加等待时间就可以了
time.sleep(3) driver.find_element_by_xpath("//div[@id='map-setting-install-3']/div/div/label/div/div/label[2]").click()
相关文章推荐
- Webdriver Element is not currently visible 解决方法
- Element is not currently visible and so may not be interactedwith 解决方法
- selenium webdriver使用过程中出现Element is not currently visible and so may not be interacted with的处理方法
- Selenium-异常:Element is not currently visible and so may not be interacted with的解决
- Selenium-异常:Element is not currently visible and so may not be interacted with的解决
- Webdriver Element is not currently visible and so may not be interactedwith 解决方法
- Firefox上运行自动化测试脚本提示元素无法点击“WebDriverException: Message: Element is not clickable at point“解决方法
- 解决Selenium报错“Element is not clickable at point...”的四种方法
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- Selenium2学习-012-WebUI自动化实战实例-010-解决元素失效:StaleElementReferenceException: stale element reference: element is not attached to the page document
- The constructor BASE64Encoder() is not accessible due to restriction on required library的解决方法,经过测试正确
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- selenium.common.exceptions.ElementNotVisibleException: Message: element not visible处理方法:selenium针对下拉菜单事件的处理
- 运行用例时,报错Unknow Error:Element xxx is not clickable……的解决方法
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- 解决Selenium报错:Element is not clickable at point (x, y). Other element would receive the click
- The prefix "mvc" for element "mvc:annotation-driven" is not bound 的解决方法
- Python安装Imaging报错:The _imaging C module is not installed问题解决方法
- springMVC- The prefix "mvc" for element "mvc:annotation-driven" is not bound 解决方法