Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Xray - Import JUnit file to a test with a custom field

Itay Stainfeld March 20, 2022

Hi all,

I am trying to import a JUnit file, where it has to address a custom field called "Team". I was trying to use the documentation here: https://docs.getxray.app/display/XRAY/Taking+advantage+of+JUnit+XML+reports

It didn't work for me, I tried to send in many many variations, and I wanted to ask what do I have to add to my file.

 

My JUnit file(one of my attempts):

<?xml version="1.0"?>
<testsuites>
  <testsuite name="Convert Currencies Happy Flow EUR to USD TIP 36095" timestamp="2022-03-17T14:41:06" time="68.129" tests="1" failures="0" errors="0" skipped="0">
    <properties>
      <property name="specId" value="0" />
      <property name="suiteName" value="Convert Currencies &quot;Happy-Flow&quot; - EUR to USD - TIP-36095" />
      <property name="capabilities" value="chrome.99_0_4844_51.windows" />
      <property name="file" value=".\wdioTests\Platform\Timtam\MultiFX\MultiFxEURtoUSD.js" />
    </properties>
    <testcase classname="chrome.99_0_4844_51.windows.Convert_Currencies_&quot;Happy-Flow&quot;_-_EUR_to_USD_-_TIP-36095" name="Pre Test Update virtual account amount" time="8.016" Team="Infra">
      <properties>
        <property name="test_summary" value="A custom j Metoraf" />
        <property name="testrun_customfield:16800" value="Infra"/>
        <property name="tags" value="test1,test2"/>
      </properties>
    </testcase>
  </testsuite>
</testsuites>

 

The name of the field inside Jira: Team

The custom field name: customfield_16800

How it looks via my Jira

image.png

 

I would really appreciate your help, thanks!

1 answer

1 accepted

0 votes
Answer accepted
Stefan Salzl
Community Champion
March 20, 2022

Hi @Itay Stainfeld and welcome to the community,

one question up front:
the screenshot looks like from a jira issue (as there is a resoltion field). Maybe I‘m wrong but I‘m not used to a resolution field in a test run. Are you trying to update a field in the test execution or in the test run?

Best
Stefan

Itay Stainfeld March 20, 2022

First of all, @Stefan Salzl thanks for your response!

I am trying actually to update the test item under the test execution. My request to the server is:

https://****/rest/raven/2.0/import/execution/junit?testExecKey=TIR-43577

Stefan Salzl
Community Champion
March 20, 2022

@Itay Stainfeld 

Could you please provide a screenshot of the whole item you‘d like to update?

Bes
Stefan

Itay Stainfeld March 20, 2022

Hi @Stefan Salzl sure:

image.png

I would like to update the field Team, which is a custom field using the JUnit file. I would like to know what is the correct form for example. The name of the field is also known as (custom_field_16800). I would like to know what to send via the XML.image.png

Stefan Salzl
Community Champion
March 20, 2022

The screenshot shows the testcase which is let‘s say the base of a test run. A test run is an entity (an instance of your testcase) generated within your test execution.

So to say: The functionality you are trying to run could only update the testrun but not the testcase issue.

I know lots of different entities in that description. Hope you could follow the path. Please don‘t hesitate to ask if there are any fuether questions.

Best
Stefan

Like Itay Stainfeld likes this
Stefan Salzl
Community Champion
March 21, 2022

Hi @Itay Stainfeld 

If your question is answered please consider to click "Accept" in order to mark this case as solved.

Best
Stefan

Yoto Yogo
Contributor
November 3, 2022

Hello @Stefan Salzl,

is there a doc or code repo we can check out to know the list of properties that are supported for the "testsuite" and "testcase" nodes of the XML? 

I'd like to set:

  • the "revision" field of the test execution
  • the "revision" field of the test
  • the "fix versions", "revision", "affects versions" of the test run

The official doc is not really clear about this: https://docs.getxray.app/display/XRAYCLOUD/Taking+advantage+of+JUnit+XML+reports

Thanks,
Yoto

Like # people like this

Suggest an answer

Log in or Sign up to answer