Hi
I'm trying to import test execution results (junit) to Xray using newman-reporter-junitfull
Import Execution Results - REST v2
Developing and testing APIs using Postman
whenever I try to import the resulting .xml using cURL I receive:
{"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: s"}
Any thoughts are much appretiated
I am also importing result.xml file into Xray after test case execution. After struggling with same whitespace issue for days, I finally managed to find answer. Below solution worked for me.
I was using -F, -d to refer result.xml file in CURL. Instead I used ----data-binary @Report.xml
This --data-binary eliminates whitespace character issue.
This topic is now closed as the discussion has become outdated. If you have more questions or want to continue the conversation, feel free to start a new topic. For more details on why we close older threads, check out our Rules of engagement - Atlassian Community .
Thank you for your understanding!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please check the file encoding (e.g. by opening it with Notepad++).
It should be UTF-8.
Trying to import non UTF-8 encoded files result in the error you mentioned.
If it's UTF-8 BOM, then it's indeed incompatible with Xray Cloud.
You need to convert the file to UTF-8.
In Windows, this can be done with a Powershell script.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I'm facing a very similar issue:
When exporting a JUNIT XML file from JENKINS, using the plugin
Xray - Test Management for Jira
(https://plugins.jenkins.io/xray-connector/)
1°) Exporting to Xray Server works fine (note that the xml file isn't corrupted !)
2°) When exporting to Xray Cloud, Xray's API replies this:
09:34:39 File found: C:\Program Files (x86)\Jenkins\workspace\CEDRIC UI - SMOKE AND SANITY - PROD\CEDRIC-UI\bin\Debug\CEDRIC_UI_20230608_075743.rxlog.junit.xml 09:34:39 Starting to import results from CEDRIC_UI_20230608_075743.rxlog.junit.xml 09:34:39 ERROR: Step ?Xray: Results Import Task? failed: Unable to confirm Result of the upload..... Upload Failed! Status:400 Response:{"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: ï"}
Failed! Status:400 Response:{"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: ï"}
This is similar to the issue reported above. ...
Where does that char come from ?
line: 0 Column: 1 Char: ï
Thanks in advance !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{"error":"Invalid xml file: Non-whitespace before first tag. Line: 0 Column: 1 Char: s"}
Did you check the .xml file?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.