RanorexToPDF - Page breaks for test data and log entries

Ask general questions here.
schererw
Posts: 3
Joined: Thu Oct 04, 2018 4:17 pm

RanorexToPDF - Page breaks for test data and log entries

Post by schererw » Mon Mar 18, 2019 5:23 pm

Hello,

In my company we work primarily with user code modules to automate our data-driven tests and up to now everything has worked out out-of-the-box (or we could somehow make it work easily). So kudos to you, Ranorex! :)

We would also like to generate PDF reports for people without Ranorex access that bundle report information in one single PDF file. RanorexToPDF does exactly that so we used it in our reports.

It works most of the time, but it does not like Ranorex test cases with
a) long (multi-line) report outputs with one report API call
Ranorex.Report.Info(longStringWithManyNewlines)
b) many test parameters/variables
In both cases the report is cut short. We can work around a) by splitting long output before calling the report API, but I see no way to work around b)

The Ranorex solution attached to this post demonstrates the problem. Do you have any ideas?
  • Ranorex 8.1.1
  • RanorexToPDF 1.0.15
  • Windows 7 Service Pack 1 64bit
  • also see included report for additional information
Thanks!
Attachments
ReportToPDFSample.zip
Ranorex solution demonstrating the problem
(3.25 MiB) Downloaded 4 times

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

Re: RanorexToPDF - Page breaks for test data and log entries

Post by Support Team » Thu Mar 21, 2019 10:01 am

Hello schererw,

Thank you for your post.

Please find a new ReportToPDF beta version here: https://upload.ranorex.com/s/2943dyMdFjnB4Yj

It contains a bug fix related to the parameter issue. Unfortunately, it's not possible to have recording actions, which would be larger than an A4 page. Please split up the information into multiple recording actions.

Please let us know, if the new version fixes your issue.

Looking forward to hearing back from you.

Sincerely,
Ranorex Support Team
.
Image

dugovic.milan
Posts: 57
Joined: Wed Jun 29, 2016 1:19 pm
Location: Frankfurt, Germany
Contact:

Re: RanorexToPDF - Page breaks for test data and log entries

Post by dugovic.milan » Thu Mar 21, 2019 10:07 am

So first of all, you used PDF Generator as an automation helper, what is also meant for circular emails to other departmens. So unless you specifically need this feature, this won't be needed and there's also a different approach to it. I checked your project Test Suite settings and you're missing couple of adjustmens...

Image

So I'd simply adjust your Test Suite as following
  • I highly recommend putting all the reports file in one standalone folder. This way you're on a safe spot, that you won't miss any files during conversion
  • (forgot to highlight) Set your file format to html. Don't worry, if you did the first step, you're not loosing your .rxlog files
  • If you run your tests from Jenkins or any other remote device, set your timestamp to machine time. It saves you from having Jenkins not working properly form time to time
  • Compressed copy is just a precaution of mine
  • JUnit is also another technical precaution
Image

Next, download this file https://www.ranorex.com/rx-media/rx-blo ... utable.zip and this user code to your solution

Code: Select all

ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd", "/c " + "<YOUR_PATH_TO_RxPDF>\\Ranorex.PDF.exe <YOUR_PATH_TO_RXZLOG_FILE\\<REPORT>.rxzlog <YOUR_PATH_TO_PDF_FILE\\<REPORT>.pdf");

procStartInfo.RedirectStandardOutput = true;
procStartInfo.UseShellExecute = false;
procStartInfo.CreateNoWindow = true;
			
// wrap IDisposable into using (in order to release hProcess) 
using(Process process = new Process()) {
process.StartInfo = procStartInfo;
process.Start();
			
// Add this: wait until process does its work
process.WaitForExit();
			
// and only then read the result
string result = process.StandardOutput.ReadToEnd();
Console.WriteLine(result);
Does it help?
Ranorex Explorer @DVAG
=====================
Support my Ranorex Ideas & Improvements
My current approach: Ranorex 8.3.0

dugovic.milan
Posts: 57
Joined: Wed Jun 29, 2016 1:19 pm
Location: Frankfurt, Germany
Contact:

Re: RanorexToPDF - Page breaks for test data and log entries

Post by dugovic.milan » Thu Mar 21, 2019 10:14 am

Support Team wrote:
Thu Mar 21, 2019 10:01 am
Hello schererw,

Thank you for your post.

Please find a new ReportToPDF beta version here: https://upload.ranorex.com/s/2943dyMdFjnB4Yj

It contains a bug fix related to the parameter issue. Unfortunately, it's not possible to have recording actions, which would be larger than an A4 page. Please split up the information into multiple recording actions.

Please let us know, if the new version fixes your issue.

Looking forward to hearing back from you.

Sincerely,
Ranorex Support Team
Hello Support Team, is there any page where can we download older or the latest RanorexToPDF?
Ranorex Explorer @DVAG
=====================
Support my Ranorex Ideas & Improvements
My current approach: Ranorex 8.3.0

schererw
Posts: 3
Joined: Thu Oct 04, 2018 4:17 pm

Re: RanorexToPDF - Page breaks for test data and log entries

Post by schererw » Thu Mar 21, 2019 12:44 pm

Hello,

The new version has solved the problem. If I create the PDF now, I end up with 37 parameters on page 3 (Parameter1 through Parameter37) and 18 parameters (Parameter38 through Parameter55) on page 4.

Thank you very much.

Edit: Here is a quick comment that I missed on my first test: When the font size is smaller than default, RanorexToPDF does not print more lines on one page, even though more lines would fit. The magic number for lines printed on one page seems to be 37 at the moment. This is okay for us. Just an idea for enhancing the solution. Cheers!

Edit 2: A minor nit-pick: At the bottom of each page of parameter table output RanorexToPDF prints a horizontal line visually indicating that the table ends right there. This is done regardless of whether the table continues on the next page or not. It would be nice to visually differentiate between tables that continue on the next page and those that do not.
Last edited by schererw on Thu Mar 21, 2019 2:59 pm, edited 1 time in total.

schererw
Posts: 3
Joined: Thu Oct 04, 2018 4:17 pm

Re: RanorexToPDF - Page breaks for test data and log entries

Post by schererw » Thu Mar 21, 2019 1:09 pm

dugovic.milan wrote:
Thu Mar 21, 2019 10:07 am
Does it help?
I did not try your solution, because Support Team has already come up with a solution.
Thanks for your effort (I did not know that you could simply change the report file type to html and get an html report; nice one!).

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

Re: RanorexToPDF - Page breaks for test data and log entries

Post by Support Team » Tue Mar 26, 2019 12:30 pm

Hello,

@schererw
I'm glad that the initial issue could be resolved.
Edit: Here is a quick comment that I missed on my first test: When the font size is smaller than default, RanorexToPDF does not print more lines on one page, even though more lines would fit. The magic number for lines printed on one page seems to be 37 at the moment. This is okay for us. Just an idea for enhancing the solution. Cheers!
Edit 2: A minor nit-pick: At the bottom of each page of parameter table output RanorexToPDF prints a horizontal line visually indicating that the table ends right there. This is done regardless of whether the table continues on the next page or not. It would be nice to visually differentiate between tables that continue on the next page and those that do not.
Thank you for the input, we will consider it for the official release of ReportToPDF v1.0.16.

@dugovic.milan
Hello Support Team, is there any page where can we download older or the latest RanorexToPDF?
All versions can be found here: https://www.nuget.org/packages/Ranorex.ReportToPDF/

Sincerely,
Robert
.
Image