美文网首页
2018-02-28 验证元素在页面中不存在

2018-02-28 验证元素在页面中不存在

作者: 柠月如风000 | 来源:发表于2018-02-28 09:35 被阅读0次

验证某个元素在页面中不存在

定义函数:

def test_verify_not(self,location): # 验证元素不存在

        try: 

            driver.find_element.find_element_by_xpath(location)

            a=True 

        except: 

            a=False 

        if a == False:

            pass

        else:

            basepage.screen_capture()      # 截屏 

            print("ERROR:",screen_name)

相关文章

网友评论

      本文标题:2018-02-28 验证元素在页面中不存在

      本文链接:https://www.haomeiwen.com/subject/quxbxftx.html