使用 JUnit4参数化的特性来创建Selenium WebDriver的数据驱动测试中遇到的错误

来源:互联网 发布:java socket聊天程序 编辑:程序博客网 时间:2024/06/08 09:56

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”











阅读全文
0 0
原创粉丝点击