Overview
In this tutorial, we will execute some tests using the Robot Framework. This tutorial explores the specific integration Xray provides for Robot Framework XML reports.
Requirements
- robot framework
- Selenium2Library
- Java (if using the Java variant of the "robot framework")
Description
Next follows several Robot test suites, each one containing several Robot test cases.
*** Settings *** Documentation A test suite with a single test for valid login. ... ... This test has a workflow that is created using keywords in ... the imported resource file. Resource resource.robot *** Test Cases *** Valid Login [Tags] CALC-1|CALC-2 Open Browser To Login Page Input Username admin Input Password admin Submit Credentials Welcome Page Should Be Open [Teardown] Close Browser
The "CALC-1" and "CALC-2" tags above can be used to link the test case to existing requirement(s) or to an existing Test. When a requirement issue key is given, a link between test and requirement is created.
The previous Robot files make use of a common resource which contains some generic variables and some reusables "keywords" (i.e. steps).
After running the tests (see bellow) and generating the Robot XML report (e.g. output.xml), it can be imported to Xray using the REST API.
If you're using Python,
robot -d output .
Or if you're using Java,
java -jar robotframework-3.0.jar -d output .
Each Robot's test case is mapped to a Generic Test in JIRA, having the summary with the name of the test case, and the "Generic Test Definition" field contains the concatenated names of the test suites along with the name of the test case. Note that Robot frameworks considers the base folder of the project as the first test suite. The way you run your tests also affects Robot's XML, so if you execute the file from somewhere else or you execute directly the file by passing it as argument, the test suites information will be potentialy different.
Under the the Execution Details of the Generic Test, in the Context section it's possible to see information about each Robot keyword (i.e. step), along with the respective status.