Test case name length and JUnit report import

Class library usage, coding and language questions.
Posts: 12
Joined: Mon Mar 30, 2020 2:10 pm

Test case name length and JUnit report import

Post by andrii.savka » Fri Apr 30, 2021 8:30 pm


So the situation is this:

We have TMS, where we import our Ranorex JUnit XML report.
To receive successful import all our test names in the report should be the same as in our TMS.
But the main problem is that we have long names, and as I understood, the test name in Ranorex has some limitations because when we try to insert the test name, it cuts off it. And we are not able to change the names of test cases in the TMS.

We had a discussion, that we can try to use Description as a name for the test.
I made some searching through the forum and found this code:

Code: Select all

var TC = Ranorex.Core.Testing.TestSuite.CurrentTestContainer as TestSuiteEntryContainer;
TC.Comment = "hi";
So it means that we can get somehow a Description using Ranorex API.

So the questions would be like that:
1. Is it possible to get a Description (Comment) using the test name?
2. Is it possible to access the JUnit report using Ranorex API during the execution, or we can only update it after execution (update XML file)?

Thanks in advance!

User avatar
Ranorex Guru
Ranorex Guru
Posts: 6544
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Test case name length and JUnit report import

Post by odklizec » Mon May 03, 2021 10:58 am


I believe I can answer the first question. Here is the code to get description from a specific TestCase:

Code: Select all

var TC = (TestCaseNode)TestSuite.Current.GetTestContainer("TestCaseName"); 
string test = TC.Comment;
As for second question, I'm not sure about this. I'm not aware of any JUnit-related Ranorex API? So I believe you need to somehow modify junit file after the test execution.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration