1. 首先需要安装 python, 安装步骤不详细描述, 请参照: http://www.cnblogs.com/jinshengshun/p/6102012.html
2. 安装 python 时, 已经包含 pip, 故直接使用 pip 安装 selenium 直接在 D:\Python\Scripts 下输入命令安装: pip install -U selenium(就是 python 的安装路径)
3. 当再次在 D:\Python\Scripts 下输入命令安装: pip install -U selenium 提示 selenium 已经安装了, 并且告诉我们安装得路径;
此时, python+selenium 环境基本已搭建好
考虑到和浏览器得兼容, 需要装 driver 本次使用的为 chrome 浏览器所以需要安装 Chrome driver
下载地址为: http://download.csdn.net/detail/lansefaji/8758887
http://chromedriver.storage.googleapis.com/index.html?path=2.20/
将下载下来的. exe 文件拷贝到 Chrome 的安装目录, 并且将该目录添加到环境变量 Path 中
至此, 环境的搭建已经完成啦, 可以开始写自动化代码啦~~~
selenium 和 python 自动化测试环境搭建
来源: http://www.bubuko.com/infodetail-2490333.html