自动化测试(1)selenium+python+chrome 连接测试
时间:2020-07-18 22:19:40
收藏:0
阅读:80
环境准备:
python版本:3.6.8
开发工具:pycharm
使用chrome和对应的webdriver
http://npm.taobao.org/mirrors/chromedriver/
如何安装chromedriver?
将chromedriver放在chrome目录下,并解压运行

配置环境变量

测试chromedriver是否配置成功,输入chromedriver

python下载selenium,输入pip install selenium

测试selenium
from selenium import webdriver driver = webdriver.Chrome()#chrome浏览器 driver.get(‘http://baidu.com/‘)#访问百度 print(driver.title)#打印标题 driver.quit()

评论(0)