Log Report Multiple Project

Ranorex Studio, Spy, Recorder, and Driver.
wlijo
Posts: 25
Joined: Thu May 07, 2015 8:50 pm

Log Report Multiple Project

Post by wlijo » Tue Jun 13, 2017 10:48 pm

Hi to all,

I've a solution with 2 project this topic help me so much, I can execute both, but I cannot get the report for the second one, i get something like this

Code: Select all

Test Suite 'Open2Web' started.Test Case 'TestCase' started.Test Module 'OpenRanorex' started.Opening web site 'https://www.ranorex.com/' with browser 'chrome' in normal mode.Test Module 'OpenRanorex' completed with status 'Success'.Test Case 'TestCase' completed with status 'Success'.Test Suite 'Open2Web' completed with status 'Success'.Test Suite 'SecondPage' started.Test Case 'TestCase' started.Test Module 'OpenGoogle' started.Opening web site 'https://www.google.com' with browser 'chrome' in normal mode.Test Module 'OpenGoogle' completed with status 'Success'.Test Case 'TestCase' completed with status 'Success'.Test Suite 'SecondPage' completed with status 'Success'.
I think this is because i don't have .rxlog.data

I can see in the folder the .rxlog and .rxlog.data for the first project and for the second one, but for this show test in progress.

On the other hand when I set to get all the information in the same rxlog I have the same problem, I cannot find rxlog.data

I leave an attachment with a simple solution as example that opens 2 pages (ranorex.com and google.com), the second fail on purpose

I want to obtain the result for both project.

I hope someone can help me with this

Thanks in advance
You do not have the required permissions to view the files attached to this post.

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Log Report Multiple Project

Post by asdf » Wed Jun 14, 2017 3:13 pm

Hi Wlijo,

It seems that the reports gets generated. One in the Open2Web output and one in the SecondPage ouput directory.
May I ask, if this is what you are looking for?

Kind regards,
asdf

wlijo
Posts: 25
Joined: Thu May 07, 2015 8:50 pm

Re: Log Report Multiple Project

Post by wlijo » Wed Jun 14, 2017 4:11 pm

Hi asdf,

Both report are generated in Open2Web, but only works Open2Web, SecondPage shows in progress.

When i don't add any code I obtain this
Image

When I add in Program.cs of Open2Web

Code: Select all

string logFileName = "NewReport1.rxlog";
// unique logfile name for each of your project
Report.Setup(ReportLevel.Info, logFileName, true);
and this code in Program.cs of SecondPage

Code: Select all

string logFileName = "NewReport2.rxlog";
// unique logfile name for each of your project
Report.Setup(ReportLevel.Info, logFileName, true);
I obtain this
Image

and when I add

Code: Select all

string logFileName = "NewReport.rxlog";
// unique logfile name for each of your project
Report.Setup(ReportLevel.Info, logFileName, true, true);
and this code in Program.cs of SecondPage

Code: Select all

string logFileName = "NewReport.rxlog";
// unique logfile name for each of your project
Report.Setup(ReportLevel.Info, logFileName, true, true);
I obtain this
Image


Walter

asdf
Posts: 174
Joined: Mon Mar 21, 2016 3:16 pm

Re: Log Report Multiple Project

Post by asdf » Fri Jun 16, 2017 1:48 pm

Hi wlijo,

I don't think that this is the best approach to start 2 projects in a row.
I would suggest creating a batch file wich starts the tests one after the other.

Code: Select all

Open2Web.exe
set var = %errorlevel%
SecondPage.exe
set var2 = %errorlevel%
Please make sure that you delete the reference from your second project from your Program.cs.

You could also use

Code: Select all

Ranorex.Core.Reporting.TestReport.SaveReport();
before the return value in the program.cs. This will show you the exception in the second report, however the report remains in the progress state.

Please be aware that changes in the Program.cs could be very hard to analyze and are not recommended at all.

Hope that helps.

Kind regards,
asdf