Page 1 of 1

Print 'Passed' instead 'Success' on Ranorex Report Header

Posted: Thu Feb 15, 2018 1:24 pm
by Sai
Hello Users,

I want to print 'Passed' instead 'Success' on Ranorex Report Header after i executing single recording/code module as shown in attached file. And I have followed steps at https://www.ranorex.com/blog/customizin ... x-reports/ but not succeed so please help me out ASAP.

Appreciate any reply.
Thanks in advance
Siva

Re: Print 'Passed' instead 'Success' on Ranorex Report Header

Posted: Thu Feb 15, 2018 7:21 pm
by Sai
Hello Ranorex Support Team,

Please provide support for above.

Thanks in advance.

Re: Print 'Passed' instead 'Success' on Ranorex Report Header

Posted: Fri Feb 16, 2018 9:33 pm
by Support Team
Hello Sai,

At this time, this text cannot be modified through normal means. 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.

Although, since the report data file containing the test result is an XML file, we can edit this file and modify the "result" attribute to whatever we want. Note, this is not supported and has not been thoroughly tested - use at your own risk.

ModifyStatus Code Module

Code: Select all

using System.Xml; //Add to using statments

//Change Success to Passed
Report.End();

string dataFilePath = Ranorex.Core.Reporting.TestReport.ReportEnvironment.ReportDataFilePath;

XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(dataFilePath);
XmlNodeList allActivities = xmlDoc.GetElementsByTagName("activity");
foreach (XmlNode activity in allActivities) 
	if (activity.Attributes["result"].Value.Equals("Success"))
		activity.Attributes["result"].Value = "Passed";
xmlDoc.Save(dataFilePath);
Note, for this to work, we must call Report.End(), which ends the reporting and will not allow you to add anything new. Because of this, ensure this is the last thing executed in your code module.

Alternatively, you can manually edit the ReportFile.rxlog.data file from "Success" to "Passed".

ReportFile.rxlog.data
reportresult.jpg
I hope this helps!

Cheers,
Ned