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
- SeleniumLibrary (previously Selenium2Library)
- Java (if using the Java variant of the "robot framework")
Description
Below are 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 use a common resource that contains some generic variables and some reusable "keywords" (i.e., steps).
After running the tests and generating the Robot XML report (e.g., output.xml), it can be imported to Xray via the REST API.
If you're using Python:
robot -d output .
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 Framework 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 the file directly by passing it as an argument, the test suite's information will potentially be different.
You will see information about each Robot keyword (i.e., step) and its corresponding status in the Context section of the Execution Details of the Generic Test.