【发布时间】:2018-08-17 06:09:39
【问题描述】:
单击构建时,我在 Jenkins 控制台 中遇到以下错误。但是,当我在我的 intelij IDE 中运行测试时,它运行时没有任何故障。是Jenkins这个问题还是chromedriver.exe的路径问题
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[ERROR] Tests run: 38, Failures: 1, Errors: 0, Skipped: 37, Time elapsed: 2.237 s <<< FAILURE! - in TestSuite
[ERROR] SetUp(com.ancon.automation.tests.TenantsTest) Time elapsed: 1.593 s **<<< FAILURE!
java.lang.IllegalStateException: The driver executable does not exist: /var/lib/jenkins/jobs/Ancon-Automation/workspace\src\main\java\com\ancon\automation\webDriver\chromedriver.exe**
at com.ancon.automation.tests.TenantsTest.SetUp(TenantsTest.java:62)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TenantsTest.SetUp:62 » IllegalState The driver executable does not exist: /var...
[INFO]
[ERROR] Tests run: 16, Failures: 1, Errors: 0, Skipped: 15
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.616 s
[INFO] Finished at: 2018-08-17T09:56:58+05:30
[INFO] ------------------------------------------------------------------------
**[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project Ancon: There are test failures.
[ERROR]**
[ERROR] Please refer to /var/lib/jenkins/jobs/Ancon-Automation/workspace/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Invoke top-level Maven targets' marked build as failure
注意:我发现了类似的问题,但找不到正确的答案。
【问题讨论】:
-
你能把这段代码分享给chromedriver.exe路径吗?
-
字符串文件路径 = System.getProperty("user.dir"); System.setProperty("webdriver.chrome.driver", filePath+"//src//main//java//com//ancon//automation//webDriver//chromedriver.exe"); driver = new ChromeDriver();
-
您能否在 chrome 驱动程序路径中使用单正斜杠或双反斜杠进行检查并检查?
-
我试过了,也改变了路径。但它仍然得到错误。有没有办法在不打开 Jenkins 中的 webdriver 的情况下运行脚本。 (跳过这一步)
-
IMO,
IllegalStateException是引发[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20.1:test (default-test) on project Ancon: There are test failures.的基本异常
标签: java selenium jenkins selenium-webdriver webdriver