1.Firefox

     较高版本的firefox已经不支持firepath,而大多数情况下我们要定位元素的时候,若是不能根据id,link_test,class_name进行定位时候,只能使用xpath。之前Firefox是我做web UI自动化测试的首选,现在已经转战阵营使用chrome。

使用firefox需要安装驱动geckodriver,下载链接:https://github.com/mozilla/geckodriver/releases。下载对应的版本文件后,Windows放在python的安装根目录,mac在/user/local/bin目录下

2.chrome

chrome的使用同firefox,需要安装驱动chromedriver,下载地址:http://chromedriver.storage.googleapis.com/index.html  选择相应的版本,若是chromewebdriver版本较低,会报错。chromedriver的版本号小数点后有两位数的新于一位数的,且两位数的按照数值大小,越大的越新。例如:2.33>2.19>2.7。 放置路径同上述firefox

3.IE

下载驱动IEDriverServer,安装路径同上

4.edge(只适用于win10)

驱动下载地址:https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/,下载MicroWebDriver

5.Opera

驱动下载地址:http:github.com/operasoftware/operachromiumdriver,安装方法同上

6.Sfari浏览器

最早支持Mac平台,现在已经支持windows系统,Safari的驱动被集成到了selenium server中,在Windows命令提示符下启动selenium server,用命令java -jar selenium-server-standalone-3.8.0.jar,至于如何下载selenium server请自行百度

7.htmlunit 官网:http://htmlunit.sourceforge.net/

开源的java页面分析工具,无界面浏览器,运行速度迅速。在Windows命令提示符下启动selenium server,用命令java -jar selenium-server-standalone-3.8.0.jar启动

8.PhantomJs  官网:http:phantomjs.org/

无界面浏览器。下载phantomjs.exe,复制到python的根目录下