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

Ask general questions here.
Sai
Posts: 22
Joined: Tue Jul 18, 2017 10:59 am

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

Post by Sai » Thu Feb 15, 2018 1:24 pm

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
Attachments
Rx Report Image.png
Rx Report Image.png (59.67 KiB) Viewed 295 times

Sai
Posts: 22
Joined: Tue Jul 18, 2017 10:59 am

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

Post by Sai » Thu Feb 15, 2018 7:21 pm

Hello Ranorex Support Team,

Please provide support for above.

Thanks in advance.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Fri Feb 16, 2018 9:33 pm

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
reportresult.jpg (8.13 KiB) Viewed 270 times
I hope this helps!

Cheers,
Ned
.
Image