selenium+eclispse里代码备注
1、火狐、谷歌和IE浏览器引擎都要重新下载selenium官网引擎,并设置路径才可以支持selenium3
而狐火用自己的引擎不用设置路径既可以支持selenium2也支持selenium3,谷歌和IE就不行
package Testpakage;
import org.openqa.selenium.*;
import org.openqa.selenium.WebDriver.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxDriver.*;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.safari.SafariDriver;
public class Mytest {
public static void main(String[] args) {
System.setProperty("webdriver.gecko.driver", "C:\\Users\\Administrator\\Downloads\\geckodriver-v0.8.0-win32\\geckodriver.exe");
WebDriver driver=new FirefoxDriver();
// System.setProperty("webdriver.ie.driver", "C:\\Program Files\\Internet Explorer\\IEDriverServer.exe");
// WebDriver driver=new InternetExplorerDriver();
//
// System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe");
// WebDriver driver=new ChromeDriver();
driver.get("https://www.baidu.com/");
driver.quit();
}
}
最新文章
- git clone出现的error: The requested URL returned error: 401 Unauthorized
- httphandler和httpmodule的区别
- Google Web Designer – 创建引人入胜的 HTML5 网站
- WebSphere试用过期问题处理
- 采用Unity快速开发高质量游戏的若干优化建议
- ntpdate server时出错原因及解决
- bzoj1029
- ArrayList与Vector、HashMap与HashTable
- c++ 中关于int,unsigned int , short的关系与应用
- 修复ubuntu播放wmv等视频没有声音问题
- CentOS 7 安装Apache 2.4.39
- 100Mbps和100Mb/s有什么不同
- 虚幻开放日2017ppt
- easyUi 的DataGrid的绑定
- tensorflow中 tf.add_to_collection、 tf.get_collection 和 tf.add_n函数
- 虚拟机之openVZ简单基础
- backtype.storm.generated.InvalidTopologyException:null问题的解决
- L166
- php sapi 产生core 文件
- eetcode 之String to Integer (atoi)(28)