Page 1 of 1

Test case classname renaming

Posted: Fri Mar 09, 2018 10:59 am
by arutscheidt
Hello all,

I am using the JUnit-Export feature of Ranorex reports.
I modify it and import it to our ALM System to generate test runs and issue entries.

The ALM uses a combination of the classname and name of a test case to create a unique test case name in the ALM.
When repeating the Ranorex test, it will recognize that name in further test runs and can assign it to the same entries in the ALM system.

Now my problem:
Some of the tests use Excel tables and generate names containing "...Dataiteration x" where x is the row index. Here is some code from the rxlog.junit.xml file

Code: Select all

<testcase
		name="TC_TestCaseName_DataIteration_1"
		time="10"
		classname="TestSuitName.ProjectName.SmartFolderLvl1Name.SmartFolderLvl2Name">
		<system-out>...some comment</system-out>
</testcase>
The Issue/TestRun generated by the ALM has now the Name TestSuitName.ProjectName.SmartFolderLvl1Name.SmartFolderLvl2Name.TC_TestCaseName_DataIteration_1

We then link the Issues/TestRuns with requirements and test specs in the ALM.

If, for some reason, the order of the Excel tables change or rows are added or removed, the DataIteration index will change/move, too.
This results in the wrong rows that are linked to the wrong requirements, but with the same name "DataIteration 1".

Is there a way to rename the classname and or the name to, for example, rename DataIteration 1 to a more unique word?
Maybe we can use contents from the Excel columns (name col, comment col...) to create unique names that are definitely linked to a special row?

In another post I saw someone using something like "Ranorex.Core.Reporting.TestReport..." to manipulate reports. Is ther an option for me, too?

Thanks in advance

A. Rutscheidt

Re: Test case classname renaming

Posted: Fri Mar 09, 2018 9:48 pm
by Support Team
Hello arutscheidt,

These name/classname node attributes are unique to the junit report as they do not exist in the standard report data file (*.rxlog.rxdata). Unfortunately, these cannot be changed at this time. I recommend creating a new feature request on our User Voice platform as I can see this being a useful feature. It means more when the request comes from you directly than from me.

I hope this helps!

Cheers,
Ned

Re: Test case classname renaming

Posted: Tue Mar 13, 2018 10:06 am
by arutscheidt
Thanks Ned,

unfortunately it doesn't help for my situation. So I have to rearrange my code to have the iterations as destinct as possible.

However, I created a feature request. Maybe I can benefit from it in the future.

Regards
Alex

Re: Test case classname renaming

Posted: Tue Mar 20, 2018 1:32 pm
by arutscheidt
I have got another question on this topic.

I found another post where a user modified his xsl file and could change the header of an iteration in the report.
https://www.ranorex.com/forum/rename-it ... t2757.html

In the rxlog.data there are activities with the attribute iteration.

Code: Select all

<activity
	result="Success"
	duration="5.7m"
	durationms="340885"
	type="test-case"
	rid="9c1259f2669cd40"
	totalerrorcount="2"
	totalwarningcount="0"
	totalsuccesstestcasecount="1"
	totalfailedtestcasecount="0"
	totalblockedtestcasecount="0"
	childsuccesscount="1"
	childfailedcount="0"
	childblockedcount="0"
	totalsuccesscount="1"
	totalfailedcount="0"
	totalblockedcount="0"
	totalmaintenancemodecount="0"
	testcontainername="TC_TestCaseName"
	testcontainerid="54351282-c017-4450-b975-147bd28272a3"
	headertext="TC_Parameters_BlindHBtns"
	displayName="TC_TestCaseName"
==>  iteration="2"                                             <==
	activity-exectype="dataiteration"
	conditionstate="none">
...
</activity>
So maybe we can manipulate on a higher level?

Is it possible to manipulate the iteration count of an activity?

here is an example code for the xsl file

Code: Select all

     <xsl:choose>
        <xsl:when test="./datarow/field/@name='IterationName'">
          <xsl:value-of select="./datarow/field[@name='IterationName']" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="./@iteration"/>
        </xsl:otherwise>
      </xsl:choose>
With this I could insert a data column from my Excel into the headline of a DataIteration like:
TestCaseName Data Row: %IterationName%

Hopefully the junit algorithm uses these iteration attributes for generating it "DataIteration X" postfix.

Do anybody know which xsl section is for the activity iteration number?

Thanks

A. Rutscheidt