Page 1 of 1

How to use style.xml with ReportToPDFModule

Posted: Tue Feb 20, 2018 9:08 am
by fablich
Hello,

I am facing an issue with the ReportToPDFModule (1.0.13) on Ranorex 8.0.1 using Windows 7 SP1.

I am using the ReportToPDF Module though Ranorex Automation Helper. The ReportToPDFModule is placed in the teardown section of my testcase. As long as I define the XML variable in ReportToPDFModule.cs it creates no PDF file.
So this creates a standard pdf document

Code: Select all

        public ReportToPDFModule()
        {
            //Init variables
            this.registered = false;
            this.PdfName = "";
            this.Xml = "";

            //Possible values: none | failed | all
            this.Details = "all";

        }
And changing the xml variable results in no generated PDF at all. And sadly no error message.

Code: Select all

        public ReportToPDFModule()
        {
            //Init variables
            this.registered = false;
            this.PdfName = "";
            this.Xml = "./style.xml";

            //Possible values: none | failed | all
            this.Details = "all";

        }
My Projekt looks like this:
Solution Test

Code: Select all

Solution
+---Solution Items
¦
+---Test-A
¦
+---Test-ModuleLibary
¦ 
+---RanorexAutomationHelpers
    +---...
    ¦
    +---Modules
    +---Modules
        +---...
        +---ReportToPDFModule.cs
        +---style.xml
        +---...
I tried differend types of path definition, relative and absolut. And I also tried different places to store the style.xml.
The "Copy to output direcoty" property is set for ReportToPDFModule.cs

Re: How to use style.xml with ReportToPDFModule

Posted: Thu Feb 22, 2018 11:35 am
by Support Team
Hi fablich,

Please ensure to correctly bind the necessary properties.

Example configuration:
ReportToPDFBinding.png
To check if there is an error within your style.xml, please add a Console.ReadKey() to the Program.cs file:
try
            {
                error = TestSuiteRunner.Run(typeof(Program), Environment.CommandLine);
            }
            catch (Exception e)
            {
                Report.Error("Unexpected exception occurred: " + e.ToString());
                error = -1;
            }
            
            Console.ReadLine();
            return error;
The error message will be logged to the console.

I hope this helps.

Sincerely,
Robert

Re: How to use style.xml with ReportToPDFModule

Posted: Fri Feb 23, 2018 10:38 am
by fablich
Thanks for your reply,
I don't know what detail now made the difference, but it works now on my local machine.

Sadly I've run into another issue within my organisation. It seems that the file-ending "pdf.exe" is banned from our standard clients. As the standard-clients are the base of our virtual-machines, our ranorex runetime client VMs can not store the "Ranorex.PDF.exe" file.

Maybe other users are facing the same issue? Is it possible to rename the "Ranorex.PDF.exe"-File to "RanorexPDF.exe" or something similar?

Re: How to use style.xml with ReportToPDFModule

Posted: Mon Feb 26, 2018 10:53 am
by Support Team
Hi fablich,

I'm glad that we could help.

I'm afraid that we can't easily change the name of the "Ranorex.PDF" executable, because their might be several customer, which already added the executable to their anti-virus whitelists etc.

I would highly recommend to allow just this specific file. You should still be able to block the general PDF.exe files.

Thank you for your understanding.

Sincerely,
Robert

Re: How to use style.xml with ReportToPDFModule

Posted: Wed Feb 28, 2018 9:51 am
by fablich
We are now using the Ranorex.PDF.dll File for the PDF-Report-Generation. Hopefully this dll will work with further Ranorex-Versions.
Whitelisting this file is not likely to happen since we test within our standard client configuration, which is deployed for >10k Windows Desktops.
Yesterday we had the Ranorex Foundation Level Training and one of my collegues wanted to send his Ranorex-Test-Solution via Gmail. Sadly even Gmail detects the Ranorex.PDF.exe inside a ZIP as a Virus.

Maybe you find a solution for a variarity of costumers since a Filename .PDF.exe is likely to be detected by a range of anti-virus mechanisms?

Re: How to use style.xml with ReportToPDFModule

Posted: Fri Mar 02, 2018 2:28 pm
by RobinHood42
Hey,

In my opinion sending .exe files via email in not a good idea in general. Most email providers, including Gmail, don't allow sending executable files.
File types blocked in Gmail

Cheers,
Robin

Re: How to use style.xml with ReportToPDFModule

Posted: Wed Oct 17, 2018 4:28 pm
by natesun
Hi Support team,

I am also trying to use ReportToPDFModule, and if I leave everything by default without binding any variable, the pdf report will be generated automatically. However, if I bind $Xml with style.xml, no pdf will be generated. Do I miss anything?

Re: How to use style.xml with ReportToPDFModule

Posted: Fri Oct 19, 2018 8:19 am
by RobinHood42
Hi,

Please checkout the following post: viewtopic.php?f=20&t=12785&p=51070#p51070

Cheers,
Robin

Re: How to use style.xml with ReportToPDFModule

Posted: Fri Oct 19, 2018 3:12 pm
by natesun
Thanks Robin,

It turned out the logo path was incorrect. After rebind everything and corrected the logo path, a custom PDF was generated.