Page 1 of 1

How to capture data from screen during playback?

Posted: Tue Dec 20, 2011 1:01 am
by EugeneF
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

Re: How to capture data from screen during playback?

Posted: Tue Dec 20, 2011 8:09 am
by Support Team
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

Re: How to capture data from screen during playback?

Posted: Wed Dec 21, 2011 2:11 am
by EugeneF
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.

Re: How to capture data from screen during playback?

Posted: Wed Dec 21, 2011 7:49 am
by Support Team
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

Re: How to capture data from screen during playback?

Posted: Wed Dec 21, 2011 6:17 pm
by EugeneF
Martin, thank you very much!!!

Here they are...

Re: How to capture data from screen during playback?

Posted: Wed Dec 21, 2011 6:18 pm
by EugeneF
Repository...

Re: How to capture data from screen during playback?

Posted: Wed Dec 28, 2011 8:20 am
by Support Team
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

Re: How to capture data from screen during playback?

Posted: Wed Dec 28, 2011 5:13 pm
by EugeneF
Thank you! Can you, please, send me ZIP file instead?

Thanks.

Re: How to capture data from screen during playback?

Posted: Wed Dec 28, 2011 5:40 pm
by EugeneF
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.

Re: How to capture data from screen during playback?

Posted: Thu Dec 29, 2011 11:38 am
by Support Team
Hi Eugene,

My example as Zip.

Regards
Martin,
Ranorex Support Team

Re: How to capture data from screen during playback?

Posted: Thu Dec 29, 2011 5:29 pm
by EugeneF
Thank you!