java+selenium3配置
来源:互联网 发布:怎样在淘宝做代销 编辑:程序博客网 时间:2024/06/08 00:49
由于Firefox的必要升级,导致之前的selenium2无法使用,只能对selenium进行升级
目前我的Firefox版本为v54.0,下载selenium3.4.0,下载selenium3必须要有的Firefox驱动geckodriver.exe,下载jdk8
Firefox:http://ftp.mozilla.org/pub/firefox/releases/
selenium:http://selenium-release.storage.googleapis.com/index.html
geckodriver:https://github.com/mozilla/geckodriver/releases
将selenium-server-standalone-3.4.0.jar及geckodriver.exe放到lib目录下,同时将selenium进行替换
原先我使用的是2.53.1,在右键项目-> Build Path -> Configure Build Path中进行删除,在右键selenium -> Build Path -> Add To Build Path中进行添加
selenium3.X目前需要jdk8的支持,所以还需要对编译环境进行配置
原先的java代码也需要进行修改
build.xml文件(如果是使用Junit的话):
<path id="RegressionTest.classpath"><pathelement location="bin" /><pathelement location="lib/selenium-server-standalone-3.4.0.jar" /><pathelement location="lib/junit.jar" /><pathelement location="lib/org.hamcrest.core_1.3.0.v201303031735.jar" /><pathelement location="lib/common-lang3.jar" /></path>
在driver启动代码中进行修改:
@Testpublic void initFirefox() throws Exception {System.setProperty("webdriver.firefox.marionette", "lib//geckodriver.exe");driver = new FirefoxDriver();driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);}
阅读全文
0 0
- java+selenium3配置
- Python+Selenium3最新配置
- Selenium3.5起步配置
- Python2.7 + selenium3.0配置
- selenium3.0+java环境搭建
- Java+Selenium3.3.1环境搭建
- Java+Selenium3.0系列教程
- Selenium3+Python3+PhantomJS配置及测试解析
- Selenium3+Python3+Firefox56配置及测试解析
- Java+Selenium3方法篇13-findElements举例
- Java+Selenium3方法篇25-isDisplayed方法
- Java+Selenium3方法篇39-Explicit wait
- Java+Selenium3方法篇41-FluentWait
- Java+Selenium3.0基础篇1-环境搭建
- Java+Selenium3.0基础篇2-利用geckodirver启动firefox
- Java+Selenium3.0基础篇4-如何启动IE
- Java+Selenium3基础篇5-第一个自动化测试脚本
- Java+Selenium3方法篇2-Timeout接口相关方法介绍
- opencv读取摄像头或视频文件
- Linux命令笔记
- cvCreateMemStorage//cvCreateSeq/…
- Myclass method;和Myclass&nb…
- new和malloc的区别(转载)
- java+selenium3配置
- 20 issues of porting C++ code to the 64-bit platform
- 双重指针动态开辟内存
- 一份快速实用的 tcpdump 命令参考手册
- httpsever服务器(转载)
- cvRound, cvFloor, cvCeil
- CUDA编程模型
- 类成员变量的初始化
- 9.3-全栈Java笔记:List接口常用实现类的特点和底层实现