Robot

AIO Tests simplifies the reporting of Robot results by facilitating the import of output.xml, the output file generated during robot test execution. This integration relieves developers from manually entering test cases into AIO Tests. Instead, they can create robot cases, and AIO Tests will automatically import and generate corresponding cases, incorporating their execution results.

This article outlines the process of importing Robot’s XML results, allowing for mapping existing cases in AIO Tests or generating new cases when none exist.

In this documentation, you’ll understand:

Robot

Robot is a Python-based testing framework that supports. It is designed for acceptance test-driven development (ATDD), behavior-driven development (BDD), and robotic process automation (RPA).

Robot Reporting

Robot Framework furnishes three output files: a log file, a report file, and an output file. The output file captures the test execution results in a machine-readable XML format. When tests are executed, the default name for the output file is "output.xml." This XML file is utilized to import test cases from Robot to AIO Tests.

Sample Robot XML Report

<?xml version="1.0" encoding="UTF-8"?> <robot generator="Robot 6.1.1 (Python 3.11.5 on win32)" generated="20230928 11:54:17.707" rpa="false" schemaversion="4"> <suite id="s1" name="Valid Login" source="C:\Users\ASUS\Documents\projects\pythonTest\WebDemo\login_tests\valid_login.robot"> <test id="s1-t1" name="Valid Login" line="9"> <kw name="Open Browser To Login Page" library="resource"> <kw name="Open Browser" library="SeleniumLibrary"> <arg>${LOGIN URL}</arg> <arg>${BROWSER}</arg> <doc>Opens a new browser instance to the optional ``url``.</doc> <msg timestamp="20230928 11:54:18.003" level="INFO">Opening browser 'Firefox' to base url 'http://localhost:7272/'.</msg> <status status="PASS" starttime="20230928 11:54:18.003" endtime="20230928 11:54:25.079"/> </kw> <kw name="Maximize Browser Window" library="SeleniumLibrary"> <doc>Maximizes current browser window.</doc> <status status="PASS" starttime="20230928 11:54:25.079" endtime="20230928 11:54:25.079"/> </kw> <kw name="Set Selenium Speed" library="SeleniumLibrary"> <arg>${DELAY}</arg> <doc>Sets the delay that is waited after each Selenium command.</doc> <status status="PASS" starttime="20230928 11:54:25.079" endtime="20230928 11:54:25.079"/> </kw> <kw name="Login Page Should Be Open" library="resource"> <kw name="Title Should Be" library="SeleniumLibrary"> <arg>Login Page</arg> <doc>Verifies that the current page title equals ``title``.</doc> <msg timestamp="20230928 11:54:25.095" level="INFO">Page title is 'Login Page'.</msg> <status status="PASS" starttime="20230928 11:54:25.079" endtime="20230928 11:54:25.095"/> </kw> <status status="PASS" starttime="20230928 11:54:25.079" endtime="20230928 11:54:25.095"/> </kw> <status status="PASS" starttime="20230928 11:54:18.003" endtime="20230928 11:54:25.095"/> </kw> <kw name="Input Username" library="resource"> <arg>demo</arg> <kw name="Input Text" library="SeleniumLibrary"> <arg>username_field</arg> <arg>${username}</arg> <doc>Types the given ``text`` into the text field identified by ``locator``.</doc> <msg timestamp="20230928 11:54:25.095" level="INFO">Typing text 'demo' into text field 'username_field'.</msg> <status status="PASS" starttime="20230928 11:54:25.095" endtime="20230928 11:54:25.158"/> </kw> <status status="PASS" starttime="20230928 11:54:25.095" endtime="20230928 11:54:25.158"/> </kw> <kw name="Input Password" library="resource"> <arg>mode</arg> <kw name="Input Text" library="SeleniumLibrary"> <arg>password_field</arg> <arg>${password}</arg> <doc>Types the given ``text`` into the text field identified by ``locator``.</doc> <msg timestamp="20230928 11:54:25.158" level="INFO">Typing text 'mode' into text field 'password_field'.</msg> <status status="PASS" starttime="20230928 11:54:25.158" endtime="20230928 11:54:25.173"/> </kw> <status status="PASS" starttime="20230928 11:54:25.158" endtime="20230928 11:54:25.173"/> </kw> <kw name="Submit Credentials" library="resource"> <kw name="Click Button" library="SeleniumLibrary"> <arg>login_button</arg> <doc>Clicks the button identified by ``locator``.</doc> <msg timestamp="20230928 11:54:25.173" level="INFO">Clicking button 'login_button'.</msg> <status status="PASS" starttime="20230928 11:54:25.173" endtime="20230928 11:54:25.252"/> </kw> <status status="PASS" starttime="20230928 11:54:25.173" endtime="20230928 11:54:25.252"/> </kw> <kw name="Welcome Page Should Be Open" library="resource"> <kw name="Location Should Be" library="SeleniumLibrary"> <arg>${WELCOME URL}</arg> <doc>Verifies that the current URL is exactly ``url``.</doc> <msg timestamp="20230928 11:54:25.252" level="INFO">Current location is 'http://localhost:7272/welcome.html'.</msg> <status status="PASS" starttime="20230928 11:54:25.252" endtime="20230928 11:54:25.252"/> </kw> <kw name="Title Should Be" library="SeleniumLibrary"> <arg>Welcome Page</arg> <doc>Verifies that the current page title equals ``title``.</doc> <msg timestamp="20230928 11:54:25.268" level="INFO">Page title is 'Welcome Page'.</msg> <status status="PASS" starttime="20230928 11:54:25.252" endtime="20230928 11:54:25.268"/> </kw> <status status="PASS" starttime="20230928 11:54:25.252" endtime="20230928 11:54:25.268"/> </kw> <kw name="Close Browser" library="SeleniumLibrary" type="TEARDOWN"> <doc>Closes the current browser.</doc> <status status="PASS" starttime="20230928 11:54:25.268" endtime="20230928 11:54:28.235"/> </kw> <status status="PASS" starttime="20230928 11:54:18.003" endtime="20230928 11:54:28.235"/> </test> <doc>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.</doc> <status status="PASS" starttime="20230928 11:54:17.707" endtime="20230928 11:54:28.235"/> </suite> <statistics> <total> <stat pass="1" fail="0" skip="0">All Tests</stat> </total> <tag>value</tag> <suite> <stat pass="1" fail="0" skip="0" id="s1" name="Valid Login">Valid Login</stat> </suite> </statistics> <errors> </errors> </robot>

Status Mapping Robot → AIO Tests

Robot

AIO Tests

Robot

AIO Tests

PASS

PASSED

FAIL

FAILED

SKIP

NOT RUN

NOT RUN

NOT RUN

Mapping Automated Robot Tests to AIO Tests

AIO Tests seamlessly integrates the Robot Framework for the import feature without the need for any additional dependencies or coding. 

Users can relate their cases with existing AIO cases by tagging the test cases with AIO case keys.

image-20200804-121437-20231224-090936.png
  1. Standalone Test Case Key

Tags can be used to specify the AIO Tests key.  In the example below, “SCRUM-TC-408”  has been tagged to a robot test case. This key maps the robot case to an existing case in AIO Tests.

Valid Login [Tags] SCRUM-TC-408 Open Browser To Login Page Input Username demo Input Password mode Submit Credentials Welcome Page Should Be Open [Teardown] Close Browser
  1. Automation Key

AIO Tests will not generate a new case if a Robot case lacks an AIO case key but has already been imported once. Instead, it will utilize the existing case by referencing the automation key. The automation key is derived from the source value and the test case name from the results file.

If the source is changed, the automation key will no longer map to the same case. If this is the case, the case can be marked with the AIO Case key, so that the association doesn’t break.

  1. Mapping an Automated Case to Multiple Manual Tests

A single test case in Robot can also be mapped to multiple cases in AIO Tests. In the example below, the results of the Robot case would be mapped into “SCRUM-TC-408” and “SCRUM-TC-409”.

Valid Login [Tags] SCRUM-TC-408 SCRUM-TC-409 Open Browser To Login Page Input Username demo Input Password mode Submit Credentials Welcome Page Should Be Open [Teardown] Close Browser
  1. New Case Creation

Robot test cases that are not tagged by the AIO case keys are also imported. In this case, the test name becomes the case name in AIO tests, and an automation key is generated from the source value and the test case name. The following table shows the mapping of a robot test case to AIO Test case.

Robot Test Case

AIO Test Case

Robot Test Case

AIO Test Case

Test case name

Case Title

Documentation tag inside the test case

Description

Tag annotated with @JREQ

[Tags]    @JREQ-SCRUM-1

Jira requirements

Mapping Jira Requirements

This integration also supports the mapping of Jira requirements to cases. This is achieved by tagging a test case with a Jira requirement key and a prefix @JREQ. In the examples below, test cases get created with the tagged Jira requirements.

  1. Mapping a Single Jira Requirement

  1. Mapping Multiple Jira Requirements

Mapping a Case to a Folder

Users have the option to designate a default folder for newly created cases. They can also define a mapping between a case and a folder by simply adding a tag starting with the prefix @AIO-FOLDER- and mentioning the folder hierarchy. Folder hierarchy can be separated using / Example - @AIO-FOLDER-Reports/Audit log.

This functionality is applicable only:

  • If a new case is generated through the import process.

  • If the folder structure specified in the tag already exists.

    Additionally, if configured, this will supersede the default folder setting.

  1. Mapping using the default folder option

Screenshot from 2024-02-14 11-14-14-20240214-052914.png
  1. Mapping each case using tags

Percolating Changes from Automated Tests to AIO Tests

Force Update Field

Enabling the force update of cases entails modifying the case title, description, steps, and Jira requirements for the respective test cases.

Adding or Updating Case Description 

This integration also lets users map the test case level documentation to the case description. In the example below, the contents of the documentation tag are mapped to the case description of the case “SCRUM-TC-408”.

Importing Results

Post execution of a Robot file, the output.xml file can be uploaded either via

Please follow the above links to continue to import results using either of the options.

 

For further queries and suggestions, feel free to reach out to our customer support via help@aiotests.com.