0

我正在尝试从Page-Objects Example运行示例

它在 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)

我尝试将 System.setProperty 设置为:

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

但是得到了同样的错误。

4

1 回答 1

0

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

于 2012-09-13T14:59:54.760 回答