简体   繁体   English

机器人框架未在詹金斯上运行

[英]robot framework not running on jenkins

I am trying to run robot framework on jenkins locally. 我正在尝试在jenkins上本地运行机器人框架。 When I run the robot framework locally it works perfectly fine but when I try to run it with Jenkin it does not work at all and gives this error. 当我在本地运行机器人框架时,它可以很好地运行,但是当我尝试使用Jenkin运行它时,它根本无法工作,并且会出现此错误。 ( using a mac ) (使用Mac)

Started by user Masnad Nehith
Building in workspace /Users/Shared/Jenkins/Home/workspace/test-robot-framework
 > git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
 > git config remote.origin.url https://github.com/nihitx/robot-framework-with-jenkins.git # timeout=10
Fetching upstream changes from https://github.com/nihitx/robot-framework-with-jenkins.git
 > git --version # timeout=10
using GIT_ASKPASS to set credentials githubpass
 > git fetch --tags --progress https://github.com/nihitx/robot-framework-with-jenkins.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse refs/remotes/origin/master^{commit} # timeout=10
 > git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision 5a0db902b380bacf39ffc42eb7337f62f4c59b00 (refs/remotes/origin/master)
Commit message: "new push"
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 5a0db902b380bacf39ffc42eb7337f62f4c59b00
 > git rev-list dda0a775c15f953f2f80a6a4abdf484c333b8000 # timeout=10
[test-robot-framework] $ /bin/sh -xe /Users/Shared/Jenkins/tmp/jenkins5706735847575370647.sh
+ robot -d results -v inputEmail:wow5@aurorax.co tests/Aurora.robot
/Users/Shared/Jenkins/tmp/jenkins5706735847575370647.sh: line 2: robot: command not found
Build step 'Execute shell' marked build as failure
Robot results publisher started...
-Parsing output xml:
Failed!
/Users/Shared/Jenkins/Home/workspace/test-robot-framework/Results does not exist.
    at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
    at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:460)
    at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:72)
    at hudson.plugins.robot.RobotParser$RobotParserCallable.invoke(RobotParser.java:54)
    at hudson.FilePath.act(FilePath.java:998)
    at hudson.FilePath.act(FilePath.java:976)
    at hudson.plugins.robot.RobotParser.parse(RobotParser.java:49)
    at hudson.plugins.robot.RobotPublisher.parse(RobotPublisher.java:217)
    at hudson.plugins.robot.RobotPublisher.perform(RobotPublisher.java:239)
    at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:81)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:730)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:676)
    at hudson.model.Build$BuildExecution.post2(Build.java:186)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:621)
    at hudson.model.Run.execute(Run.java:1760)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:97)
    at hudson.model.Executor.run(Executor.java:415)
Finished: FAILURE

What I understood is that jenkin's cannot find the robot command but I added the robot file to the local bin directory of my computer. 我了解到,詹金斯找不到机器人命令,但是我将机器人文件添加到了计算机的本地bin目录中。

Is the Robot Framework installed on Windows or Linux? Robot Framework是否安装在Windows或Linux上?

If it's on Windows make sure that you wrote in 'Execute batch command' the following: pybot --outputdir results <Path of you .*robot* test file> . 如果在Windows上,请确保您在“执行批处理命令”中编写了以下内容: pybot --outputdir results <Path of you .*robot* test file> And than, you have to add another 'Execute batch command' with an exit command (eg for windows it's EXIT 0 . 而且,您还必须在退出命令中添加另一个“执行批处理命令”(例如,对于Windows,它是EXIT 0

Lastly, make sure that on 'Post-build Actions' you the right directory output and files. 最后,请确保在“构建后操作”中您使用了正确的目录输出和文件。

Hi I also got permission denied problem and it can be solved by giving permission to your working directory. 嗨,我也遇到了权限被拒绝的问题,可以通过授予您的工作目录权限来解决。 by using this command chmod 777 -R path\\ofthe\\directory 通过使用此命令chmod 777 -R \\\\ path \\\\ directory

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM