Unable to run Jenkins Build...getting robot: command not found error

Hello Team,
I am getting the following error in Jenkins while trying to run a Robot script. Can you kindly suggest what extra configuration I need to do in my Jenkins setup to get rid of this? ( I have already installed the robot plugin for jenkins)

Started by user admin
Running as SYSTEM
Building in workspace /Users/sayomghosh/.jenkins/workspace/RobotFramework
[RobotFramework] $ /bin/sh -xe /var/folders/l2/_w84dps97lx3z25c0_mxpwq80000gn/T/jenkins14162264934075732540.sh

  • cd /Users/sayomghosh/Documents/ROBOT_FRAMEWORK_SCRIPTS/MainframeIntegration_1
  • bash robot_exec.sh
    robot_exec.sh: line 2: robot: command not found
    Build step ‘Execute shell’ marked build as failure
    Finished: FAILURE

And you have installed both Python and Robot Framework itself also into the jenkins node ? Jenkins plugin will not do that, it’s only used to visualize RF’s reports.

I am running Jenkins locally in my machine…in that machine both are already installed @rasjani

Jenkins will not run on your user credentials but as a separate “service account”. If robot command is not found, that typically would mean your python installation and installed packages are not in PATH for the jenkins user account.

So you have any tutorial or doc on how to do that please…currently i am logged in as a jenkins admin

On general level, expecting that “slave” node will contain all dependencies is (to me) an antipattern. Can be useful at times to speed up things but also, can be very painful at times. If you need tutorials, there’s tons of youtube stuff that you can find with “jenkins ensure tools available in slave”.

But that said, have you tried if python can be found when you run your job ? If yes, construct a virtual environment in your bash script (robot_exec.sh) and install dependencies on every job execution.

Also maybe http://rasjani.github.io/2020/02/01/benefits-of-venvs.html helps ? Its not howto tutorial but answers “why” venv’s are benefit when dealing with CI build servers…