This tutorial guides you through the process of integrating Robot Framework with Vansah Test Management for Jira to automatically send your test case results.
By following this setup, you can streamline your testing workflow, ensuring that test outcomes are recorded directly in your Jira workspace.
- Robot Framework - Test project is already setup.
- Make sure that
Vansah
is installed in your Jira workspace - You need to Generate Vansah
connect
token to authenticate with Vansah APIs.
Setting Environment Variables - Store your Vansah API token as an environment variable for security.
For Windows (use cmd)
setx VANSAH_TOKEN "your_vansah_api_token_here"
For macOS
echo export VANSAH_TOKEN="your_vansah_api_token_here" >> ~/.bash_profile
source ~/.bash_profile
For Linux (Ubuntu, Debian, etc.)
echo export VANSAH_TOKEN="your_vansah_api_token_here" >> ~/.bashrc
source ~/.bashrc
To enable Vansah Integration in Robot Framework project, follow these steps:
- ${AssetKey} is required to declare under variables section - can be empty
- ${TestCaseKey} is required to declare under variables section - can be empty
- ${SprintName}, ${ReleaseName} and ${EnvironmentName} Test Run properties values are optional.
*** Variables ***
${AssetKey} Test-3
${TestCaseKey}
${SprintName} SM Sprint 1
${ReleaseName} Release 24
${EnvironmentName} UAT
Note : Variables are case sensitive
*** Test Cases ***
Open Google Search Page 1
Open Browser To view Google Page
[Teardown] Close Browser
Set Test Variable ${TestCaseKey} Test-C10 //This is required
Set Test Variable ${AssetKey} Test-3 //This is required
Add ListenerClass.py
and VansahBinding.py
to your libraries folder
If your Vansah is pinned to any other location than US, please use :
//ListenerClass.py
vansahBind = VansahBinding()
// After line number : 18 in your ListenerClass.py add below code to update the Vansah URL
vansah.setVansahURL("Add your Vansah Connect URL")
Use below command to run your tests
robot --listener .\libraries\ListenerClass.py test
Output : Vansah Response : A new Test Run created.
C:\Users\onesh\..\GitHub\robot-vansah> robot --listener .\libraries\ListenerClass.py test
==============================================================================
Test
==============================================================================
Test.Testsuite Functional
==============================================================================
Open Google Search Page 1
DevTools listening on ws://127.0.0.1:51936/devtools/browser/6dba13bd-1197-4656-96a7-1d13dbdc67d8
....
Vansah Response : A new Test Run created.
Open Google Search Page 1 | PASS |
------------------------------------------------------------------------------
Open Google Search Page 2
DevTools listening on ws://127.0.0.1:51961/devtools/browser/ae132c3b-50ab-4560-b85b-c2b08960a157
....
Vansah Response : A new Test Run created.
Open Google Search Page 2 | PASS |
------------------------------------------------------------------------------
Test.Testsuite Functional | PASS |
2 tests, 2 passed, 0 failed
==============================================================================
Test | PASS |
2 tests, 2 passed, 0 failed
By following the above steps, your Robot Framework project will be equipped to send test run results directly to Vansah, streamlining your testing and reporting process.
Ensure that all files are placed and configured as described to facilitate successful integration.
For more details on Robot Framework, visit the docs.
For Vansah specific configurations and API details, please refer to the Vansah API documentation.