I am encountering an issue when attempting to import a Robot Framework execution report in XML format using the Xray API. The API response indicates an error: "Couldn't find generic test type."
Execute the following curl command:
curl -H "Content-Type: application/xml" -X POST -H "Authorization: ***" --data @"output.xml" https://xray.cloud.getxray.app/api/v2/import/execution/robot?projectKey=TES
Expected Behavior:
The XML file should be successfully imported, and the API response should not contain an error related to test type.
Actual Behavior:
The API response contains the following error:
{"error":"Couldn't find generic test type"}
From the endpoint shared you are using the Cloud version of Jira/Xray, so my answer is given accordingly.
Check if the "Generic" test type is configured at the project level: https://docs.getxray.app/display/XRAYCLOUD/Project+Settings%3A+Test+Types (you may also check the global settings, with the assistance of a Jira admin, as described here: https://docs.getxray.app/display/XRAYCLOUD/Global+Settings%3A+Test+Types.
If the "Generic" test type is configured correctly check if you are referring to a Test key in your test result file that is not of type Generic.
If you are you have three options:
You can check this documentation for a an example of RobotFramework integration (Xray Cloud): https://docs.getxray.app/display/XRAYCLOUD/Testing+using+Robot+Framework+integration+in+Python+or+Java