当前位置: 首页 > 知识库问答 >
问题:

Webdriver错误“驱动程序信息:Driver.version:未知”

周作人
2023-03-14

我正在尝试从页面对象示例运行示例

它在Windows 7上运行良好,但当我试图在Linux ( Fedora 15)上运行时,我遇到了一个错误:

GitHubLoginTest (1)
com.example.test.GitHubLoginTest
should_not_login_with_wrong_credentials(com.example.test.GitHubLoginTest)
org.openqa.selenium.TimeoutException: Timed out after 30 seconds waiting for title to contain "GitHub � Social Coding". Current title: "GitHub · Social Coding"
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:09:54'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.43.5-2.fc15.x86_64', java.version: '1.6.0_35'
Driver info: driver.version: unknown
    at org.openqa.selenium.support.ui.FluentWait.timeoutException(FluentWait.java:255)
    at org.openqa.selenium.support.ui.FluentWait.timeoutException(FluentWait.java:270)
    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:222)
    at com.example.pageobjects.GitHubPage.waitForPageToLoad(GitHubPage.java:40)
    at com.example.pageobjects.GitHubPage.openPage(GitHubPage.java:30)
    at com.example.pageobjects.GitHubHomePage.open(GitHubHomePage.java:31)
    at com.example.test.GitHubLoginTest.should_not_login_with_wrong_credentials(GitHubLoginTest.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

我尝试将系统.set属性设置为:

    System.setProperty("webdriver.chrome.driver", "workspace/libs/chromedriver");

但是得到了同样的错误。

共有1个答案

漆雕唯
2023-03-14

它实际上是通过在Eclipse中设置编码为UTF-8来解决的

 类似资料: