Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

Starting Release 8.2, Zephyr Enterprise documentation has moved from its current location on Atlassian to a dedicated, standalone Zephyr Enterprise Documentation page. Please see: https://support.smartbear.com/zephyr-enterprise/docs/en/zephyr-enterprise/zephyr-user-guide/zephyr-test-automation/robot-framework-integration.html

Robot Framework is an open-source test automation framework. The integration with Zephyr Enterprise works by sending a JUnit XML results file generated by the framework via API/vortex to Zephyr Enterprise.

For more info on the Robot framework, see here.

Writing Robot Framework tests

See below for an example of writing test cases with Robot Framework and Zephyr Enterprise.

*** Test Cases ***
# will match Zephyr Enterprise test case named Calculator.User can clear the display
User can clear the display
Input number 10
Press operator +
Input number 1
Press clear
Display should be empty

Note the comments above each method describing how they map to existing test cases within Zephyr Enterprise.

Configuring Robot Framework to output JUnit XML results file

No configuration is required beforehand. In order to instruct Robot Framework to generate the JUnit XML results file, all that is required is to execute the tests with -x parameter followed by the xml file name. Here is an example:

robot -x junitresult.xml mytest.robot

Uploading results to Zephyr Enterprise

Once the Robot Framework tests have been executed, the results can be uploaded to Zephyr Enterprise.

  • Using API we can upload the JUnit XML results file generated by Robot Framework.

  • Using Vortex Suite Automation containing JUnit XML results file generated by Robot Framework.

  • Using Vortex FolderWatcher file containing multiple JUnit XML results files generated by Robot Framework.

If the XML file Upload does not work, we could create a Custom template for the Robot Framework depending on the Junit XML output using the API
Example Body of the Custom Template:-

Example 1:-

{
    "name": "robot",
    "jsonTemplate": "[{\"statuses\":[{\"statusId\":\"2\",\"attachmentText\":\"Name: ${robot.suite.test:name} \\nResult: ${robot.suite.test.status:status} \\nMessage: ${robot.suite.test.status}\",\"status\":\"${robot.suite.test.status:status}\",\"statusString\":\"FAIL\"},{\"statusId\":\"1\",\"attachmentText\":\"Classname: ${robot.suite:name} \\nTestcaseName: ${robot.suite.test:name} \\nResult: ${robot.suite.test.status:status}\",\"default\":true}],\"skipTestcaseNames\":\"\",\"packageName\":\"${robot.suite:name}\",\"testcase\":{\"name\":\"${robot.suite.test:name}\"},\"strict\":true}]"
}

Example 2:-

{
    "name": "robot1",
    "jsonTemplate": "[{\"statuses\":[{\"statusId\":\"2\",\"attachmentText\":\"Name: ${robot.suite.suite.test:name} \\nResult: ${robot.suite.suite.test.status:status} \\nMessage: ${robot.suite.suite.test.status}\",\"status\":\"${robot.suite.suite.test.status:status}\",\"statusString\":\"FAIL\"},{\"statusId\":\"1\",\"attachmentText\":\"Classname: ${robot.suite.suite:name} \\nTestcaseName: ${robot.suite.suite.test:name} \\nResult: ${robot.suite.suite.test.status:status}\",\"default\":true}],\"skipTestcaseNames\":\"\",\"packageName\":\"${robot.suite.suite:name}\",\"testcase\":{\"name\":\"${robot.suite.suite.test:name}\"},\"strict\":true}]"
}
  • No labels