Selenium作为网站UI测试利器,为黑盒功能测试人员所喜爱。
下载Selenium的最新版本地址:http://selenium-release.storage.googleapis.com/index.html
友情提示:如果一直下载不了,可能是浏览器与下载工具的没有兼容,或者没安装下载工具的插件。用IE浏览器打开,可以完整下载。如果没有这个问题就忽略。
时至今日,Selenium已经到了3.3.1版了(2017年3月7日)。
自从Selenium3发布以来,火狐浏览器(Selenium支持火狐的技术最为成熟,因为可以方便获取从而控制网页信息,也是测试人员最喜欢用的浏览器之一)成为了一个普遍的问题。
因为Selenium3不支持向前支持火狐浏览器了,40以后版本的火狐,运行会出现问题。
例如Java代码:(实现打开浏览器,输入"WebDriver",搜索后,关闭浏览器)
package com.selenium.test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class seleniumHello {
public static void main(String[] args) {
//如果火狐浏览器没有默认安装在C盘,需要自己确定其路径
System.setProperty("webdriver.fire