您的位置:首页 > 其它

使用 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”
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: