Eric
Eric

Reputation: 23

Jenkins pipline with Robotframework UI test cases

Have setup jenkins pipline with my robot framework but my project structure is

Parent folder/
│
├── module 1/
│   ├── TC1.robot
│   └── TC2.robot
│
└── module 2/
    ├── TC1.robot
    └── TC2.robot

I am running command to execute test cases in below way

robot -d results path/to/module1/

then all test cases get executed and same for module2 but then I do rebot to merge all test case. I would like to get some input on how can I execute all test cases in one go in jenkins and if some test cases fail I should be able to re execute and rebot all test cases and send final report.

I tried to write execute as windows command in jenkins. Path to all module test cases rerun failed test cases rebot

but that script has become long. can someone please provide best way to execute?

Upvotes: 2

Views: 916

Answers (3)

KeithMc18
KeithMc18

Reputation: 112

Firstly you should declare the output files using -o

If you're looking to rerun your failed test you can -R or --rerunfailed with robot or pabot for parallel execution.

Then run --merge with rebot and call the two output folders you require.

This is separated to make it more readable but I have this running on a single line in Jenkins.

pabot -d results  -o Output.xml Tests & 
pabot -d results -o rerun.xml -R results\Output.xml Tests & 
rebot -d results --merge results/Output.xml results/rerun.xml

In your case Tests would be 'Parent Folder'

Upvotes: 2

Vikash Pandey
Vikash Pandey

Reputation: 43

Use below command to run:

robot -L INFO path/to/module1/

Upvotes: 0

A. Kootstra
A. Kootstra

Reputation: 6981

Given your example I would set the folder to the common parent. All test cases in both folders will then be executed.

robot -d results parent folder/

Upvotes: 0

Related Questions