selenium web 自动化环境搭建(Windows7 环境, Chrome, Python)
2017-06-20 13:02
711 查看
转型自http://www.cnblogs.com/fnng/archive/2013/05/29/3106515.html,结合实际操作稍做整理。
1. 下载Python
点击打开链接
2. 安装Python
建设对路径做设置,Windows7默认生成的路径比较尴尬。
建设勾选Add Python X.X to PATH,可以省得配置环境变量。本文使用的版本是3.6.0
3. 安装selenium
C:\Users\Administrator>python -m pip install selenium
4. 下载chromedriver
官网需要梯子,可以到CSDN资源站下载。如:http://download.csdn.net/download/wl520a/9748152
放至Chrome安装目录下,如:Google\Chrome\Application,并添加环境变量
5. 编写测试脚本 test.py (Python版本3.6)
6. 执行脚本
1. 下载Python
点击打开链接
2. 安装Python
建设对路径做设置,Windows7默认生成的路径比较尴尬。
建设勾选Add Python X.X to PATH,可以省得配置环境变量。本文使用的版本是3.6.0
3. 安装selenium
C:\Users\Administrator>python -m pip install selenium
4. 下载chromedriver
官网需要梯子,可以到CSDN资源站下载。如:http://download.csdn.net/download/wl520a/9748152
放至Chrome安装目录下,如:Google\Chrome\Application,并添加环境变量
5. 编写测试脚本 test.py (Python版本3.6)
#coding=utf-8 from selenium import webdriver driver=webdriver.Chrome() #调用chrome浏览器 driver.get('https://www.baidu.com') print (driver.title) driver.quit()
6. 执行脚本
相关文章推荐
- 基于selenium3+python3.6.x+chrome57.x的自动化测试环境搭建
- Web自动化环境搭建(selenium+python)
- windows python3自动化环境 selenium3 chrome(63.0.3239.84)搭建
- Jenkins-测试自动化环境搭建(Python+RobotFramework+selenium)
- (selenium 一)python+webdriver环境搭建
- python3 + selenium3 web自动化测试环境搭建
- Windows下怎么搭建Python+Selenium的自动化环境
- Selenium Web 自动化 - Selenium(Java)环境搭建
- win7 python2.6+selenium webdriver环境搭建
- Ubuntu16.04 Selenium+python 环境搭建 Chromedriver安装
- 构建Python+Selenium2(2=WebDriver)自动化测试环境<二>:IE、Chrome和Firefox运行
- Selenium Webdriver Python 测试环境搭建
- python+selenium2.0的自动化环境的搭建
- python+selenium自动化环境搭建常见问题
- selenium+python+webdriver自动化测试之环境搭建
- Selenium + Python 搭建自动化测试环境(三)
- Selenium Webdriver 自动化测试环境搭建、入门
- python selenium-webdriver 环境搭建(一)
- 构建Python+Selenium2自动化测试环境<二>:IE、Chrome和Firefox运行