Problem: When you run the Robot Framework with Jenkins and found the error. The command does not see in Jenkins. Robot, Pybot is not recognized.
Error1: Pybot or robot: command not found
Error2: Build step 'Execute shell' marked build as failure
Solution1: Check your Robot Framework
- Check your Robot Framework is already installed.
which robot
- The system should return robot path /usr/local/bin/robot
- If Robot Framework does not install, please install as below
pip3 install robotframework
Solution2: Check your Robot Framework installed in Jenkins
Go to Jenkins > Manage Jenkins > Manage Plugins > Install Robot Framework
Solution3: Check your command in Jenkins
Solution4: Set Robot bash profile
Open bash profile
touch ~/.bash_profile; open ~/.bash_profile
nano ~/.bash_profile
Find Robot path
which robot
Default Robot path /usr/local/bin/robot, Copy robot path to bash profile
Solution5*: Check your Python version
Check your python version
python --version
Normally, Mac Book defaults to python version 2.7 but it can run in Jenkins(expect python version 3.x). So you should replace python 2.7 with python 3.x. We have the other way to set up. Howeaver in this solution, we propose to set up with path.
vi ~/.bash_profile
set this path
alias python='/usr/local/bin/python3'
Reload bash profile
source ~/.bash_profile
Check your python version again
Solution6: Restart Jenkins
use the following command to restart Jenkins
brew services restart jenkins-lts