如何使用Selenium Server在Jenkins上运行作业

时间:2015-07-22 09:47:29

标签: selenium jenkins jenkins-plugins selenium-ide

我从Jenkins启动了我的测试IDE并且作业失败。在控制台输出中,我检测到了这样的信息:“无法访问jarfile C:\ dev \ selenium \ standalone \ selenium-server.jar”。

我验证了jar可以由所有人执行...

我发布了这个命令:

``java -jar selenium-server.jar -trustAllSSLCertificates -userExtensions "ftp://selenium:Y3ey6KnDg4D3@zei335a1:721/js/user-extensions.js" -htmlsuite "*firefox" https://zed330z7:59443/stm_ihm/ "ftp://selenium:Y3ey6KnDg4D3@zei335a1:721/tests_suites/Total_Courbes.htm" "ftp://selenium:Y3ey6KnDg4D3@zei335a1:721/rapports/rapport.html"`
来自詹金斯,我获得了:

`Started by user sm14b10n
    [EnvInject] - Loading node environment variables.
    [EnvInject] - Preparing an environment for the build.
    [EnvInject] - Keeping Jenkins system variables.
    [EnvInject] - Keeping Jenkins build variables.
    [EnvInject] - Injecting contributions.
    Building in workspace /appli/projects/jenkins_atos/jenkins/workspace/STM_V1_V2_TESTS
    [STM_V1_V2_TESTS] $ cmd /c call /var/jenkins/jenkins_atos/tmp/hudson8121199609581456632.bat
    FATAL: command execution failed
    java.io.IOException: Cannot run program "cmd" (in directory "/appli/projects/jenkins_atos/jenkins/workspace/STM_V1_V2_TESTS"): java.io.IOException: error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
        at hudson.Proc$LocalProc.<init>(Proc.java:244)
        at hudson.Proc$LocalProc.<init>(Proc.java:216)
        at hudson.Launcher$LocalLauncher.launch(Launcher.java:803)
        at hudson.Launcher$ProcStarter.start(Launcher.java:381)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:97)
        at hudson.tasks.CommandInterpreter.perform(CommandInterpreter.java:66)
        at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
        at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
        at hudson.model.Build$BuildExecution.build(Build.java:199)
        at hudson.model.Build$BuildExecution.doRun(Build.java:160)
        at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:533)
        at hudson.model.Run.execute(Run.java:1745)
        at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
        at hudson.model.ResourceController.execute(ResourceController.java:89)
        at hudson.model.Executor.run(Executor.java:240)
    Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
        at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
        at java.lang.ProcessImpl.start(ProcessImpl.java:81)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
        ... 15 more
    Build step 'Execute Windows batch command' marked build as failure
    Publishing Selenium report...
    Missing directory ftp://selenium:Y3ey6KnDg4D3@zei335a1:721/rapports/*.html
    Build step 'Publish Selenium Html Report' marked build as failure
    [BFA] Scanning build for known causes...

    [BFA] Done. 0s
    Started calculate disk usage of build
    Finished Calculation of disk usage of build in 0 seconds
    Started calculate disk usage of workspace
    Finished Calculation of disk usage of workspace in 0 seconds
    Finished: FAILURE`

你能否就这个问题向我提出意见?

先谢谢,

最诚挚的问候,

1 个答案:

答案 0 :(得分:0)

  1. 为Selenium IDE Test Suite创建批处理文件。 Tutorial

    • 下载Selenium Server并开始在IDE中创建测试。
    • 将IDE测试保存在适当的位置。
    • 创建一个批处理文件,给出IDE测试的位置。

      java -jar selenium-server-standalone-2.45.0.jar -htmlSuite "*firefox" "%baseurl%" "%suite%"
      
  2. 创建Jenkins作业以运行批处理文件。 Tutorial

    • 在您的计算机上下载并配置Jenkins。
    • 通过添加构建步骤作为执行Windows批处理命令来创建Jenkins作业。
    • 运行Jenkins作业以执行IDE测试。