使用 JUnit4参数化的特性来创建Selenium WebDriver的数据驱动测试中遇到的错误
2017-09-05 15:21
465 查看
1.在运行时报错:“ java.lang.Exception: Test class should have exactly one public zero-argument constructor ”。
解决方法:class上忘了加“@RunWith(value=Parameterized.class)”
2.报错:"java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property"
解决方法:在WebDriver driver = new FirefoxDriver();前面加上 System.setProperty("webdriver.firefox.marionette","F:\\ckx\\geckodriver\\geckodriver.exe");
3.报错:“Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.”------无法启动新的会话。可能的原因是远程服务器或浏览器启动失败的无效地址。
解决方法:把地址“http://www.baidu.com”改成“https://www.baidu.com”
解决方法:class上忘了加“@RunWith(value=Parameterized.class)”
2.报错:"java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property"
解决方法:在WebDriver driver = new FirefoxDriver();前面加上 System.setProperty("webdriver.firefox.marionette","F:\\ckx\\geckodriver\\geckodriver.exe");
3.报错:“Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.”------无法启动新的会话。可能的原因是远程服务器或浏览器启动失败的无效地址。
解决方法:把地址“http://www.baidu.com”改成“https://www.baidu.com”
相关文章推荐
- Selenium WebDriver使用Junit创建数据驱动测试
- 如何使用Selenium WebDriver报告Javascript错误
- 使用selenium的webdriver动态爬取网页时遇到的问题
- Selenium ide及webDriver使用
- oracle 11g使用deferred_segment_creation 延迟段创建特性时遇到的问题总结
- Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap
- Selenium WebDriver使用经验杂记
- Selenium2 webdriver的简单使用(基于163邮箱的写信功能)
- 在Selenium WebDriver中使用By.Xpath快速定位页面元素
- MVC中以Html.Action形式调用PartialView的Action,如果该Action使用了OutputCache特性,且使用了该特性的CacheProfile属性(即从WebConfig中读取缓存配置),会出现错误:Duration 必须为正数。
- Selenium2(webdriver)入门之TestNG的使用
- Selenium2(webdriver)入门之TestNG的安装与简单使用
- 使用VS2003创建WEB程序的时候出现"AutoMation服务器不能创建对象"错误
- 使用WebDriver遇到的那些坑
- (org.jbehave.core.failures.BeforeOrAfterFailed: webdriver selenium错误解决。
- 在Selenium WebDriver中使用By.Xpath快速定位页面元素
- Selenium-webdriver—使用Page Object设计模式
- Selenium WebDriver使用IE浏览器 属性设置
- Selenium WebDriver使用经验杂记
- Eclipse使用Maven创建Web时错误:Could not resolve archetype org.apache.maven.archetypes:maven-archetype-webap