08.访问链接

情景

web UI测试里最简单也是最基本的事情就是访问1个链接了。

在python的webdrive中,访问url时应该使用get方法。

创建test.py输入一下代码

from selenium import webdriver
import time

dr = webdriver.Chrome()
time.sleep(2)

url = 'http://www.baidu.com'
print(('now access {}').format(url))
dr.get(url)

time.sleep(5)
print('close brower')
dr.quit()

猜你喜欢

转载自www.cnblogs.com/luoshuifusheng/p/9141085.html
今日推荐