Reusing Custom Reports from module library

Ranorex Studio, Spy, Recorder, and Driver.
ArneW
Posts: 5
Joined: Thu Aug 09, 2018 5:44 pm

Reusing Custom Reports from module library

Post by ArneW » Thu Aug 09, 2018 6:07 pm

I am currently customizing our reports to show more relevant information. Everything was going great so far until I tried to reuse the custom report.

Our solution has quite some projects which all refer to a single module library. So I thought the module library was the best location to place the customized report. This way every project would be able to easily use the report template.

I got to the point where Ranorex even correctly copies the template to the output folder of every project. Unfortunately I can't figure out how to configure the individual projects/test suites so that they use the custom report. When trying to select the template folder from the module library, Ranorex complains about that folder being outside of the project directory.

I really don't want to clutter all our projects by copying the *.xsl, *.css and *.png etc. around. Is there something obvious I did wrong?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Reusing Custom Reports from module library

Post by Support Team » Mon Aug 13, 2018 9:45 am

Hello ArneW,

Thank you for your post.

First of all, please make sure to update Ranorex to our latest version, currently Ranorex 8.2.1. We fixed several issues, also related to specified report paths. Afterwards, simply specify the template folder within the Ranorex TestSuite settings:
ReportTemplate.png
I hope, this information helps.

Sincerely,
Robert
You do not have the required permissions to view the files attached to this post.

ArneW
Posts: 5
Joined: Thu Aug 09, 2018 5:44 pm

Re: Reusing Custom Reports from module library

Post by ArneW » Mon Sep 03, 2018 1:01 pm

Hi,

Sorry for the delay. I made sure to update Ranorex to the latest version now.

Unfortunately our issue did not resolve. To better show my intended use case I quickly built a solution roughly like ours:
sample.png
Please note that we don't deploy the output folder of our module library, just the output folder of our TemplateSampleProject.

I expected this to work but I am afraid it doesn't. We need this because copying our template around is just not feasible and honestly feels like a workaround when this is what the module library should be there for.
You do not have the required permissions to view the files attached to this post.

ArneW
Posts: 5
Joined: Thu Aug 09, 2018 5:44 pm

Re: Reusing Custom Reports from module library

Post by ArneW » Mon Sep 03, 2018 1:02 pm

Please also note, that all items from the "MyTemplate" folder get correctly copied to the output folder of the TemplateSampleProject:
output.png
PS Sorry for the double post. I somehow can't attach more than one screenshot.
You do not have the required permissions to view the files attached to this post.

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Reusing Custom Reports from module library

Post by McTurtle » Tue Sep 04, 2018 2:44 pm

Hello ArneW,

You can use a relative path:
RelativeCustomReportPath.png
This will copy the custom report folder to the output of "TemplateSampleSolution" from "TemplateSampleLibrary" and also use the same template when the report of the "TemplateSampleSolution" is created. All this without having to have a "MyTemplate" folder in the project "TemplateSampleSolution" ;)

You need to type the path manually. Ranorex Studio will else always write an absolute path.

Does this help?

Regards,
McTurtle
You do not have the required permissions to view the files attached to this post.

ArneW
Posts: 5
Joined: Thu Aug 09, 2018 5:44 pm

Re: Reusing Custom Reports from module library

Post by ArneW » Tue Sep 04, 2018 5:41 pm

Hi,

No, unfortunately that also doesn't really fix the issue. Moving the output folder of TemplateSampleSolution around before executing it leads to this error:
error.png
Where D:\Workspace\Testfolder\ ist the path I am executing the compiled output from. Obviously Ranorex can't find the folder of TemplateSampleLibrary from there.

I assume the processed content of TemplateSampleProject.rxtst is a bit off on this:
			<testsuite
			ReportTime="RelativeToTestSuiteStartTime"
			TracingScreenshotMode="Foreground"
			TracingScreenshotQuality="40"
			enabletracingscreenshots="True"
			id="cd534c05-94e0-49a8-a3a5-844dea530d66"
			name="TemplateSampleProject"
			placescreenshotsinfolder="True"
			reportcompress="False"
			reportfilename="%S_%Y%M%D_%T.rxlog"
			reporttemplatefolder="..\..\..\TemplateSampleLibrary\MyTemplate"
			reportwriteinterval="30000ms"
			showinvisiblechars="True">
			</testsuite>
Manually fixing it to
			<testsuite
			ReportTime="RelativeToTestSuiteStartTime"
			TracingScreenshotMode="Foreground"
			TracingScreenshotQuality="40"
			enabletracingscreenshots="True"
			id="cd534c05-94e0-49a8-a3a5-844dea530d66"
			name="TemplateSampleProject"
			placescreenshotsinfolder="True"
			reportcompress="False"
			reportfilename="%S_%Y%M%D_%T.rxlog"
			reporttemplatefolder="MyTemplate"
			reportwriteinterval="30000ms"
			showinvisiblechars="True">
			</testsuite>
makes the report work correctly but that of course would get overwritten on each build.

Ranorex seems to always prepend ..\..\ internally no matter what I enter into the template selection box.

Any other idea to make this work?

Greetings,
Arne
You do not have the required permissions to view the files attached to this post.

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Reusing Custom Reports from module library

Post by McTurtle » Thu Sep 06, 2018 3:03 pm

Hey Arne,

If this is what you want :)

Ok, another suggestion:

1. When building the test suite Ranorex needs to know where to take the report template from. Therefore, you need to have this setting in the Report settings:
reportTemplate.png
2. In the program.cs you can override the setup of the reporting environment by adding the following around line 35 before the try-catch:
TestReport.Setup(ReportLevel.Info,"",true,"./MyTemplate");
This works for me, even when moving around the output folder.

Does it also help you?

Sincerely,
McTurtle
You do not have the required permissions to view the files attached to this post.

ArneW
Posts: 5
Joined: Thu Aug 09, 2018 5:44 pm

Re: Reusing Custom Reports from module library

Post by ArneW » Fri Sep 07, 2018 11:04 am

Hi McTurtle,

Thanks for all your effort.

I added the setup code to my Program.cs just where you said it should be and set the relative path in my settings too. Unfortunately I am still not able to move my output around while keeping custom reports working at the same time.

I attached my current sample solution. Maybe you can figure out what I am still missing there.

Thanks again for going through the trouble. I really appreciate the great support!

TemplateSampleSolution.zip
You do not have the required permissions to view the files attached to this post.

McTurtle
Posts: 297
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Reusing Custom Reports from module library

Post by McTurtle » Tue Sep 11, 2018 1:01 pm

Hey Arne,

I could swear this worked... But now I am also failing to make it work. No idea what happened. I guess the module library is meant more for modules than for report templates :) At this point I would suggest that you write to the support so they can look into it.

Regrads,
McTurtle

Shakib
Posts: 32
Joined: Tue Jan 06, 2015 7:22 am

Re: Reusing Custom Reports from module library

Post by Shakib » Fri Sep 21, 2018 4:14 pm

Hi,
Take backup of your custom report folder.
Delete the existing custom report folder.
Set restore to default under properties for report.
Build the solution and make sure no report error comes.
Go to property and create custom report.
Copy all back up files to new custom report folder.
Rename if required.
Pass same name under property for report by following .\FolderName


Try to follow from attached image.
You do not have the required permissions to view the files attached to this post.