1

Good afternoon,

I'm using robotframework to run some tests. After I run them I have an output.xml file with the results.

I searched ways to import these results to Xray and found these links: https://docs.getxray.app/display/XRAY/Testing+using+Robot+Framework+integration+in+Python+or+Java https://docs.getxray.app/display/XRAY/Import+Execution+Results+-+REST#ImportExecutionResultsREST-RobotFrameworkXMLresults

So I created a .sh file with this command line:

#!/bin/bash
 
PROJECT=myproject
TESTPLAN=mytestplan
 

curl -X POST -H "Content-Type: multipart/form-data" -u myuser:mypassword -F "file=output.xml" "https://myserver/rest/raven/1.0/import/execution/robot?projectKey=$PROJECT&testPlanKey=$TESTPLAN"

It displays this error '' Forbidden (403)''.

Do you know how to solve this?

Ricky
  • 79
  • 1
  • 11
  • did you forgot to put @ in -F parameter of curl ? Isnt it should be "file=@output.xml" ? curl documentation says `To force the 'content' part to be a file, prefix the file name with an @ sign` otherwise it might be going as binary stream. – Sariq Shaikh Oct 07 '20 at 20:30
  • @SariqShaikh hi, I've tried and it also doesn't work :( – Ricky Oct 29 '20 at 17:12

1 Answers1

0

I guess you're using Xray on Jira server/Data Center and not Jira Cloud, correct? Is so, it should be something like:

curl -H "Content-Type: multipart/form-data" -u admin:admin -F "file=@output.xml" "http://<jira_base_url>/rest/raven/1.0/import/execution/robot?projectKey=ROB&testPlanKey=ROB-12&testEnvironments=$BROWSER"

Note that sometimes <jira_base_url> is something like http://<some_ip>/jira .. is it your case perhaps?

Note: In this tutorial, you can find a concrete example for Xray on Jira server/DC. A similar tutorial for Xray on Jira Cloud can be found here.

Sérgio
  • 1,777
  • 2
  • 10
  • 12