selenium-java自动化测试环境搭建

1、jdk环境配置(参见如下地址)

https://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html

2、eclipse安装(略)

3、selenium相关jar包导入(参见如下地址)

https://blog.csdn.net/hszxd479946/article/details/74892265

 

4、测试环境是否搭建成功

package lsg;

 

import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;

 

public class Lsg {

public static void main(String[] args) {

System.setProperty("webdriver.gecko.driver","E://selenium//geckodriver-v0.23.0-win64//geckodriver.exe");

System.setProperty("webdriver.firefox.bin","C://Program Files//Mozilla Firefox//firefox.exe");

WebDriver driver=new FirefoxDriver();

driver.get("http://www.baidu.com");

}

 

 

}

 

成功。

猜你喜欢

转载自www.cnblogs.com/laonainai/p/9884979.html