Page 1 of 1
Loop as Data Rows in the Report
Posted: Mon Jun 12, 2017 8:17 pm
by dpereira
Hi all,
I have a code module written in C# with a loop iteration, such like this:
Code: Select all
for (int i=0; i<10; i++) {
Report.Info("User Test",i.ToString());
}
I'd like to have my report file to get a new Data Row for each iteration since each iteration can fail or not. See image in attachment. How can I do that with the Ranorex API? is it even possible?
Thanks in advance
Re: Loop as Data Rows in the Report
Posted: Mon Jun 12, 2017 11:01 pm
by Vega
Maybe I'm misunderstanding your question, but its sounds like you want to go to the next row of data after execution in service disruption has completed an iteration? This is the standard behavior for Ranorex when using data binding out of the box, all you may need to do is modify the error behavior for your test case so that it continues on error.
I see from the image that you only have one row of data. Are you planning to add more or are you trying to modify the data connector during run time?
Data iteration:
https://www.ranorex.com/support/user-gu ... tml#c16079
Error behavior:
https://www.ranorex.com/support/user-gu ... tml#c16087
Re: Loop as Data Rows in the Report
Posted: Thu Jun 22, 2017 2:42 pm
by dpereira
Thanks for the prompty help. Let me explain better.
What I really want to do is to create the same report structure from data binding with iterations loops.
The report structure using data binding is something like this below where this example shows 10 rows. Look how the report is organized. Each row iteration has a test result.
[img]report.png[/img]
What I really what to do is to get the same report structure using loops. I'd like my report to have the same structure from data binding.
Look what happens when I execute this code below.
[img]loop_report.png[/img]
How can I make the report have the same layers from the picture above?
Re: Loop as Data Rows in the Report
Posted: Thu Jun 22, 2017 4:13 pm
by Vaughan.Douglas
What version of Ranorex are you using? Ranorex 7.x has changed some of reporting functionality. Before you start anything too crazy, you might want to make sure you're running the current version of the tool.
Re: Loop as Data Rows in the Report
Posted: Fri Jun 30, 2017 2:01 pm
by dpereira
Hi,
I am using the last version of Ranorex.
I couldn't find a useful way to work with the Report API. Any help will works
Thanks
Re: Loop as Data Rows in the Report
Posted: Mon Jul 03, 2017 12:42 pm
by asdf
Hi Dpereira,
I'm pretty sure that it is not possible to use a for loop as a data connector. May I ask you what exactly you are trying to achive? Maybe there is a proper workaround for your intention.
Best regards,
Asdf
Re: Loop as Data Rows in the Report
Posted: Mon Jul 03, 2017 3:27 pm
by Vaughan.Douglas
I'm going to have to agree with Asdf here. We need to better understand what you're really trying to accomplish.
Are you asking to do something like this:
for (int i=0; i<10; i++) {
//Execute testcase with data from data source row "i"
}
That might get you something that looks more like your report.png image, but no matter how you slice it I don't see what if any advantage trying to manually do this would provide over the built in data driven approach provided by Ranorex.
Re: Loop as Data Rows in the Report
Posted: Wed Jul 05, 2017 12:18 pm
by dpereira
Hi,
What I am trying to achieve is to get the report structure shown in the attachment.
I am looking for a way to divide the iterations in subtabs in the test report. I can't find more information on how I can work with the Report API.
I hope you guys have an idea now on what I am trying to do. If not, I can explain in other ways.
Thanks,
dpereira.
Re: Loop as Data Rows in the Report
Posted: Wed Jul 05, 2017 2:35 pm
by Vaughan.Douglas
Why do you need to use loops?
Re: Loop as Data Rows in the Report
Posted: Thu Nov 23, 2017 4:32 pm
by dpereira
I don't want to use loops. Just want to use the Report API.
Re: Loop as Data Rows in the Report
Posted: Fri Nov 24, 2017 3:14 pm
by McTurtle
Hello dpereira,
I think that the Report API is not what you need. In order to aggregate the results of the test run into a table view you will have to create a customer report template. The Ranorex user guide does not cover much about this topic:
Create a Custom Report Template
I found a guide under the following link:
How to Customize Report of Ranorex Tool?
However, I did not test this. Please take a look and let us know if this is what you were looking for. As mentioned in the guide, you will require quite some knowledge of HTML and XSLT. If you don't know anything about these, then I would suggest to you to stick with the default report.
Regards,
McTurtle