(selenium系列之六)selenium 获取验证信息

常用的验证信息有 title、URL、text,获取方式如下:

title = driver.title

now_url = driver.current_url

user = driver.find_element_by_id("user").text

验证:

assert '百度' in title

assert now_url == "http://www.baidu.com"

猜你喜欢

转载自blog.csdn.net/m0_37553368/article/details/81635037