Convert Ranorex Report to PDF

Class library usage, coding and language questions.
saravanan_palanivel
Posts: 4
Joined: Wed Oct 25, 2017 2:26 pm

Convert Ranorex Report to PDF

Post by saravanan_palanivel » Wed Oct 25, 2017 2:45 pm

Hi Team,

We are using Ranorex 7.2 libraries to write test cases through Visual Studio 2015. We are successful so far in implementing use case for our Java Swing application :)

Query : We are trying to convert our test case execution result report (*.rxlog) into PDF format, so that everyone in our team can read them without having Ranorex Report Viewer installed. To accomplish this we did write following code snippet,
// Stop Report
Report.End();

var reportFileDirectory = TestReport.ReportEnvironment.ReportFileDirectory;
var ReportName = TestReport.ReportEnvironment.ReportName;

var rxlogFile = String.Format(@"{0}\{1}.rxlog", reportFileDirectory, ReportName);
var rxzlogFile = String.Format(@"{0}\{1}.rxzlog", reportFileDirectory, ReportName);
var PDFReportFilePath = String.Format(@"{0}\{1}.pdf", reportFileDirectory, ReportName);

TestReport.SaveReport();

// Create rxzlog file
Report.Zip(rxlogFile, reportFileDirectory, ReportName);

// Create PDF file
Creator.CreatePDF(rxzlogFile, PDFReportFilePath, "", "all");
Problem :
But above wasn't successful, and what we are getting from above code is below,
Ranorex.Core.FastXml.XmlDocException : Element 'activity' does not exist in element 'activity'.
06:11:16 at Ranorex.Core.FastXml.XmlNode.Child(String name)
06:11:16 at Ranorex.PDF.PDFCreator.CreateHeader(XmlNode rootActivity)
06:11:16 at Ranorex.PDF.PDFCreator..ctor(XmlNode rootNode, String xml, RanorexGraphics rg)
06:11:16 at Ranorex.PDF.Program.Main(String[] args)
06:11:16 at Ranorex.PDF.Creator.CreatePDF(String input, String output, String xml, String details)


Note : When i try the above same code with Test Suite in Ranorex Studio, its working as expected - meaning it is generating pdf of test results.
But in our case, we are using nunit to run our tests and we do not have any Test Suite kind of stuff.

Could someone please guide me on how to resolve this issue and help me to generate pdf of our test case execution results

Many thanks in advance!

- Saravanan

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Convert Ranorex Report to PDF

Post by krstcs » Wed Oct 25, 2017 7:20 pm

The Ranorex report is an HTML file. If you change the names of the report file and the data file to the following, they can be read by any browser (for IE "Allow local files" must be turned on).

Report.rxlog => Report.html
Report.rxlog.data => Report.html.data
Shortcuts usually aren't...

saravanan_palanivel
Posts: 4
Joined: Wed Oct 25, 2017 2:26 pm

Re: Convert Ranorex Report to PDF

Post by saravanan_palanivel » Thu Oct 26, 2017 10:55 am

Thank you! its solved my problem :)

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Convert Ranorex Report to PDF

Post by krstcs » Thu Oct 26, 2017 3:34 pm

So, I should add that if you need PDF, it should work using Ranorex's helper, but I'm not on 7.2, so I can't help with that part yet.

I'm glad you were able to use what I pointed out though! You're very welcome!
Shortcuts usually aren't...

reach2shrikant
Posts: 2
Joined: Wed Apr 04, 2018 9:15 pm

Re: Convert Ranorex Report to PDF

Post by reach2shrikant » Thu Apr 19, 2018 12:42 am

Where should we add this code?

mrkeyo
Posts: 2
Joined: Thu Feb 28, 2019 10:32 am

Re: Convert Ranorex Report to PDF

Post by mrkeyo » Mon Dec 16, 2019 2:48 pm

Hi,
Can any one advice where exactly I should to change it to resolve this problem ? ;/

RanorexToPDF Ver 1.0.10
Ranorex Studio 9.2.0.0

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

Re: Convert Ranorex Report to PDF

Post by odklizec » Mon Dec 16, 2019 2:57 pm

Hi,

What problem exactly? This is an old and no longer discussed post.

There is a detailed (step-by-step) screencast, describing how to convert Ranorex reports to PDF. See "Ranorex Studio Reporting 5: Converting reports" on this link:
https://www.ranorex.com/resources/
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