selenium3.4.2在win7上的安装

本文介绍如何在Windows 7平台上使用Python 3.6.1和Selenium 3.4.2进行自动化测试,包括安装配置流程、支持的浏览器及对应的驱动下载链接,并提供了调试方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

平台:win7(64位)  Python3.6.1  selenium3.4.2
前置条件:已安装Python3.6.1
1.打开CMD,输入pip.exe install selenium

2.selenium默认支持Firefox的,3.0版本的selenium调用firefox的时候要用geckodriver.exe,下载这个文件放到Python36\Scripts目录下就行(Python36\Scripts目录在环境变量)。
3.cmd中,输入Python,然后输入from selenium import webdriver ,再输入webdriver.Firefox()
如果可以启动火狐浏览器,说明安装OK

4.如果需要在谷歌浏览器或者IE浏览器中运行,还需要下载chromedriver.exe和IEDriverServer.exe


下载chromedriver.exe :http://chromedriver.storage.googleapis.com/index.html
下载 IEDriverServer.exe  和 selenium server  .jar  :http://selenium-release.storage.googleapis.com/index.html
下载 geckodriver.exe :  https://github.com/mozilla/geckodriver/releases/    火狐用
下载  所有的  driver.exe :https://www.npmjs.com/package/selenium-webdriver
目前, selenium IDE,只有 火狐浏览器插件  , 阿里云 ,也有类似 自动化测试插件的工具。
selenium 官网 IDE 等一系列 下载地址:http://www.seleniumhq.org/download/
阿里云,在线 自动化测试 地址:http://fts.aliyun.com/index.htm


其他的网址:
 selenium 3.0 + 火狐浏览器,启动问题 解决方案 :http://blog.youkuaiyun.com/u010969970/article/details/52228689
chromedriver与chrome各版本及下载地址  http://blog.youkuaiyun.com/cz9025/article/details/70160273

geckodriver.exe各个版本下载 https://github.com/mozilla/geckodriver/releases/

selenium+python环境搭配:
selenium2+firefox46以下版本(无需驱动包)
selenium3+firefix47以上版本(需geckodriver.exe)


参考文章
使用selenium IDE 等一系列需要下载的东西的地址  http://blog.youkuaiyun.com/cz9025/article/details/70160273


笔记:路径中以u开头的,应当在路径前添加r


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值