selenuim webDriver API 16种定位方式

错误截图:

这是由于html页面嵌套多个iframe导致的 

解决办法:操作右侧的鼠标滚轮   滚动到上面就可以了

#操作鼠标滚轮   0,0表示最上面 
js = 'window.scrollTo(0,0)'
driver.execute_script(js)
import time
time.sleep(2)

 

posted @ 2018-09-29 12:11  测试路上的白小白  阅读(133)  评论(0编辑  收藏  举报