2

Hello im a new junior test software and i've been asked to study about xray and robot framework and how to implement both.

I've made a few Test cases in xray and after i've started to learn about robot framework and till there was all good.

Now i've been trying to implement the results of this tests cases that i made on robot to the tests execution in xray but everytime that i try to import the output.xml from robot to xray instead of "syncronize" this tests the xray creats me new tests care with the result of the robot.

There is anyone around that has done it before that could help me? i've tryed to implement tags in robot or even use the same name of tests (in xray and robot) but it didnt work. Thanks in advance.

IKK
  • 31
  • 1
  • 4
  • Please try to upload the files using the REST API (or using Jenkins for example), to see if that behavior persists. You can see an example using "curl" utility, here: https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST#ImportExecutionResultsREST-RobotFrameworkXMLresults Something like (you have to adapt it): curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" http://yourserver/rest/raven/1.0/import/execution/robot?projectKey=XTP – Sérgio Mar 19 '21 at 09:43

2 Answers2

1

I recommend using Jenkins with the XRay - Jira plugin to sync the results of automated tests into xray test items. You would use a Tag in robot to link a test case to an Xray Test item or if you don't specify an ID, the plugin would create a new Test item and keep it updated based on name

*** Test Cases ***
Add Multiple Records To Timesheet By Multi Add Generator
    [Tags]    PD-61083

Check this link for details on how to configure the integration https://docs.getxray.app/display/XRAY/Integration+with+Jenkins

The plugin can keep track of the execution in a specific Test Execution item or create one per run but should keep referring to the same Test item.

rupio
  • 81
  • 1
  • 7
1

When you upload the RF results, Xray will auto-provision Test issues, one per each Robot Framework's Test Case. This is the typical behavior, which you may override in case you want to report results against an existing Test issue. In that case, you would have a Test in Jira and then you would add a tag to the RF Test Case entry, with the issue key of the existing Test issue.

However, taking advantage of auto-provisioning of Tests is easier and is probably the most used case. Xray, will only provision/create Test issues if they don't exist; for this, Xray tries to figure out if a generic Test exists, having the same definition (i.e. name of RF Test suites plus the Test Case name). If it does find it, then it will just report results (i.e. create a Test Run) against the existing Test issue. If Test issues are always being created each time you submit the test results, that's an unexpected behavior and needs to be analyzed in more detail.

There is another entity to have in mind: Test Execution. Your results will be part of a Test Execution. Every time that you submit test results, a Test Execution... unless, you specify otherwise. In the REST API request (or in the Jenkins plugin) you may specify an existing Test Execution by its issue key. If you do so, then the results will be overwritten on that Test Execution and no new Test Execution issue will be created. Think on it as reusing a given Test Execution.

How the integration works and the available capabilities are described in some detail within the documentation. As an additional reference, let me also share this RF tutorial as it may be useful to you.

Sérgio
  • 1,777
  • 2
  • 10
  • 12
  • Till where i can see in the screenshots i've showed i belive im using the same name of testes and using the tag aswell to identify the jira xray Key but still dosnt work :/ or maybe im doing something else wrong no idea – IKK Mar 18 '21 at 23:20
  • @Jonas can you please share screenshots of all the steps that you're doing? – Sérgio Apr 14 '21 at 13:09