How to capture data from screen during playback?

Ask general questions here.
EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

How to capture data from screen during playback?

Post by EugeneF » Tue Dec 20, 2011 1:01 am

How to capture data from screen during playback?

I need to capture data from spreadsheet, save it and use it for validation later in the script.

How I can capture and save data to variable?

Thanks.

Eugene

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

Re: How to capture data from screen during playback?

Post by Support Team » Tue Dec 20, 2011 8:09 am

Hello,

Please have a look on the following two links
Ranorex Code Modules
Ranorex Code Examples
Note, that it is also possible to have User Code within your RecordingModules (Add New Action -> User Code).

For your specific problem, you have to create an adapter out of your spreadsheet and iterate through the data.
A good example for this might be the example creating a list of adapters.

To save the data note, that you are in a full .NET environment.

Hope this will help you

Regards,
Martin
Ranorex Support Team
.
Image

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: How to capture data from screen during playback?

Post by EugeneF » Wed Dec 21, 2011 2:11 am

I have a control (text cell) - FormFSC_Rater___California_A.CellAnnual where I would like to take data from and save it to variable for future comparison with another variable.

So, can you please provide me with a script that I can run from recording modules?

Thank you in advance.

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

Re: How to capture data from screen during playback?

Post by Support Team » Wed Dec 21, 2011 7:49 am

Hi,

Can you please send me a snapshot of your application in the state where you have a filled data grid which you want to iterate and get data out of it?
Can you also provide your recording module (rxrec) with the depending repository file (rxrep).

This will help me to show you how to get the data out of your elemets.

Regards,
Martin
Ranorex Support Team
.
Image

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: How to capture data from screen during playback?

Post by EugeneF » Wed Dec 21, 2011 6:17 pm

Martin, thank you very much!!!

Here they are...
Attachments
Recording2.rxrec
Recording file
(68.05 KiB) Downloaded 148 times
FSC_Rater_RatingResults_table.rxsnp
Data table it self
(258.48 KiB) Downloaded 142 times
FSC_Rater_RatingResults.rxsnp
Whole screen
(419.94 KiB) Downloaded 134 times

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: How to capture data from screen during playback?

Post by EugeneF » Wed Dec 21, 2011 6:18 pm

Repository...
Attachments
FSC_RaterRepository.zip
Repository
(101 KiB) Downloaded 284 times

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

Re: How to capture data from screen during playback?

Post by Support Team » Wed Dec 28, 2011 8:20 am

Hi,

Sorry for my late response.
I have created a sample for you - it is based on VIP Database which is in the samples folder of Ranorex.
Just unpack and open the rxsln file and run the example. It is filling a grid with data and iterating through the grid's data, reporting the data to a report.
Use your own data structure to save the data for later use.

Best Regards,
Martin
Ranorex Support Team
Attachments
VIPTestSuite(8).rar
(1017.9 KiB) Downloaded 151 times
.
Image

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: How to capture data from screen during playback?

Post by EugeneF » Wed Dec 28, 2011 5:13 pm

Thank you! Can you, please, send me ZIP file instead?

Thanks.

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: How to capture data from screen during playback?

Post by EugeneF » Wed Dec 28, 2011 5:40 pm

Hi Martin,

I am capturing data using the following code:

string sCell_0_0, sCell_0_10, sCell_0_RT;

sCell_0_0 = repo.FormFSC_Rater___California_A.RowN0.Cell_0_0.Text;
sCell_0_10 = repo.FormFSC_Rater___California_A.RowN0.Cell_0_10.Text;
sCell_0_RT = repo.FormFSC_Rater___California_A.RowN0.Cell_0_RT.Text;
Report.Log(ReportLevel.Info, sCell_0_0);
Report.Log(ReportLevel.Info, sCell_0_RT);
Report.Log(ReportLevel.Info, sCell_0_10);

It's probably not the best way to do my task, however, it works.
Is there any possibility to save my variables into Excel or any other file types?

Thanks.

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

Re: How to capture data from screen during playback?

Post by Support Team » Thu Dec 29, 2011 11:38 am

Hi Eugene,

My example as Zip.

Regards
Martin,
Ranorex Support Team
Attachments
VIPTestSuite(8).zip
(1.04 MiB) Downloaded 206 times
.
Image

EugeneF
Posts: 63
Joined: Fri Jul 29, 2011 12:26 am

Re: How to capture data from screen during playback?

Post by EugeneF » Thu Dec 29, 2011 5:29 pm

Thank you!