2
votes

I have test cases that I wrote using robot framework and selenium. When the build fails, I want to rerun the failed test cases only. Thus, I tried this script

robot --output output.xml tests.robot ||
robot --rerunfailed output.xml --output output2.xml tests.robot ||
rebot --output output.xml --merge output.xml output2.xml

with a conditional step (single) in jenkins. However, I get

'robot' is not recognized as an internal or external command, operable program or batch file.

when I specify the script to execute as Windows batch command. I also tried to run it as Shell Script, but that also throws an exception. Where should I specify this script and what is the name (type) of this command to use to run it in jenkins?

1
It sounds like you don't have robot installed on the jenkins machine. Or, it's installed but the installation directory is not on your PATH. This doesn't have anything to do with re-running test cases. - Bryan Oakley
Thanks Bryan for the response. The robot framework plugin is installed but I'm not sure how to check if the installation directory is in my PATH. How can I do that? - aby
This has nothing to do with the plugin. Robotframework itself isn't installed. The jenkins plugin is something extra. You still have to install robotframework in the normal way. - Bryan Oakley

1 Answers

0
votes

If the Robot Framework plugin is installed correctly in Jenkins then try to run it as a shell script-

sh 'robot --output output.xml tests.robot || robot --rerunfailed output.xml --output output2.xml tests.robot || rebot --output output.xml --merge output.xml output2.xml'