1

現在、セレン テストを実行するように Jenkins を構成する作業を行っています。

Jenkins 構成の Selenium RC スロットで Seleniumhq プラグインSelenium HTML ランナーを使用しています*。

特定のジョブでは、シェル スクリプトを実行export PATH=$PATH:/path/to/geckodriver.exeしてパスに追加し、その後に SeleniumHQ htmlSuite Run ステップを実行します。

この構成で実行すると、ジョブは失敗し、次のエラー メッセージが表示されます。

 Started by timer
Building in workspace /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace
[workspace] $ /bin/sh -xe /tmp/hudson2672803749243149546.sh
+ export PATH=/var/lib/jenkins/tools/hudson.model.JDK/Oracle_8u45/bin:/var/lib/jenkins/tools/hudson.model.JDK/Oracle_8u45/bin:/var/lib/jenkins/.rvm/gems/ruby-2.2.2/bin:/var/lib/jenkins/.rvm/gems/ruby-2.2.2@global/bin:/var/lib/jenkins/.rvm/rubies/ruby-2.2.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/var/lib/jenkins/.rvm/bin:/path/to/geckodriver.exe
 java -jar /var/lib/jenkins/users/me/selenium-html-runner-3.0.1.jar -htmlSuite *firefox example.com /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace/suite1/JenkinsTestSuite /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace/result.html
[workspace] $ java -jar /var/lib/jenkins/users/ME/selenium-html-runner-3.0.1.jar -htmlSuite *firefox example.com /var/lib/jenkins/jobs/myjob-selenium-ide-test/workspace/suite1/JenkinsTestSuite /var/lib/jenkins/jobs/MYJOB-selenium-ide-test/workspace/result.html
Multi-window mode is longer used as an option and will be ignored.
Dec 14, 2016 6:31:00 PM org.openqa.selenium.server.htmlrunner.HTMLLauncher mainInt
WARNING: Test of browser failed: *firefox
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.gecko.driver system property; for more information, see https://github.com/mozilla/geckodriver. The latest version can be downloaded from https://github.com/mozilla/geckodriver/releases
    at com.google.common.base.Preconditions.checkState(Preconditions.java:199)
    at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
    at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:37)
    at org.openqa.selenium.firefox.GeckoDriverService$Builder.findDefaultExecutable(GeckoDriverService.java:95)
    at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
    at org.openqa.selenium.firefox.FirefoxDriver.createCommandExecutor(FirefoxDriver.java:277)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:247)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:242)
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:135)
    at org.openqa.selenium.server.htmlrunner.HTMLLauncher.createDriver(HTMLLauncher.java:285)
    at org.openqa.selenium.server.htmlrunner.HTMLLauncher.runHTMLSuite(HTMLLauncher.java:107)
    at org.openqa.selenium.server.htmlrunner.HTMLLauncher.mainInt(HTMLLauncher.java:245)
    at org.openqa.selenium.server.htmlrunner.HTMLLauncher.main(HTMLLauncher.java:273)

Publishing Selenium report...
ERROR: Test reports were found but none of them are new. Did tests run? 
For example, /var/lib/jenkins/jobs/myjob-selenium-ide-test/workspace/suite1/results.html is 7 days 1 hr old

Build step 'Publish Selenium Report' changed build result to FAILURE
Finished: FAILURE

問題は、ラインSystem.setProperty("webdriver.gecko.driver","path/to/geckodriver.exe");を実行する必要があることです。これが発生するように適切に構成するにはどうすればよいですか? (Groovy ビルドステップとして実行しようとしましたが、失敗しました)。

*(以前のバージョンのスタンドアロン サーバーに置き換えようとしたこともあります)

4

0 に答える 0