Page 1 of 2

compare : Excel data and those PDF

Posted: Mon Mar 30, 2015 9:26 am
by denatora971
I need your help,

problem:
I have an Excel file with the data in the cells cell 1 = XX, YY = cell 2 and cell 3 = zz.
I have PDF files that are the results of a series of calculations, and every PDF I have values xx ', yy' and zz '.

I have to compare the data from the Excel file and those from the PDF: xx = xx ', yy = yy' and zz = zz '.
My simulation is correct if the values xx = xx ', yy = yy' and zz = zz 'are equal or substantially equal.

issue:
This kind of test is it feasible in Ranorex? if so, how I should proceed? especially how to retrieve values in a PDF file?

Re: compare : Excel data and those PDF

Posted: Mon Mar 30, 2015 1:42 pm
by odklizec
Hi,

It should be possible to validate the text in PDF, as long as the PDF is exported with enabled accessibility. Check this post...
http://www.ranorex.com/forum/how-to-get ... t4267.html

Re: compare : Excel data and those PDF

Posted: Mon Mar 30, 2015 2:30 pm
by denatora971
Thank you very much

But the discussion does not solve my problem.

My problem, to be more clear in how Ranorex I can compare two values from two separate sources, one Excel and the other PDF?

For PDF: I found a solution that copy the values in the PDF and paste them into an Excel file.

Re: compare : Excel data and those PDF

Posted: Mon Mar 30, 2015 2:36 pm
by odklizec
Hi,

I was under the impression that one of your problems is that you are not able to get the values from PDF file? This is what was that discussion good for ;)

Anyway, I'm afraid, thee is not an automatic/easy way to compare values from two sources with different content structure (PDF and XLS). It will most probably require some coding. But it's hard to tell without seeing an example of PDF and XLS file. Can you provide some samples?

Re: compare : Excel data and those PDF

Posted: Mon Mar 30, 2015 3:06 pm
by denatora971
thank you,

I have found a way to work around the problem, I have automated feeding another Excel file, you copying the text from the PDF to an Excel file (ExcelTest.xls). The file is attached.

Once the values copied to the attached file, how can I compare the values of line 2 with the values of line 3, 4, ... x.

example:
column A
Cell Cell A2 = A3, success
Cell Cell A2 = A4, not success
Cell A2 = Cell A5, success

column B
Cell Cell B2 = B3, success
Cell B2 = Cell B4, not success
Cell B2 = Cell B5, success

column C
Cell Cell C2 = C3, success
Cell Cell C2 = C4, not success
Cell C2 = Cell C5, success

Re: compare : Excel data and those PDF

Posted: Tue Mar 31, 2015 8:38 am
by odklizec
Hi,

Since you already using Excel, I would suggest to use the Excel data connector to achieve what you want. I'm afraid, some coding is required. See the attached sample project, simulating validation of your sample results. It may be not the most efficient way, but it should do the trick ;) Hope this helps?

Re: compare : Excel data and those PDF

Posted: Tue Mar 31, 2015 9:02 am
by denatora971
Ok, I will test,
thank you very much.

Supply Data in Excel line / line (Pb increment)

Posted: Thu Apr 16, 2015 11:20 am
by denatora971
I want to feed an Excel file from another data source.
I wish power line at my Excel file,
example:
Line 1:
Data A -> CellE2
Data B -> CellF2

Line 2:
Data C-> CellE3
Data D -> CellF3

By cons, my problem is that:
Line 1:
Data A -> CellE2
Data B -> CellF2

Line 1:
Data C-> CellE2
Data D -> CellF2

So I fail to increment my lines of the Excel file on each iteration.

Re: compare : Excel data and those PDF

Posted: Thu Apr 16, 2015 11:23 am
by odklizec
Hi,

I'm afraid, I have no clue what you are trying to do. Could you be more specific? A sample project would be very helpful.

Re: compare : Excel data and those PDF

Posted: Thu Apr 16, 2015 11:47 am
by denatora971
you can retrieve the file here

http://dl.free.fr/getfile.pl?file=/Js9jgecb

Id : ranorex
mp : ranorex

Thanks,

Re: compare : Excel data and those PDF

Posted: Thu Apr 16, 2015 11:48 am
by denatora971
its my project

Re: compare : Excel data and those PDF

Posted: Thu Apr 16, 2015 12:01 pm
by denatora971
Iteration 1:
Txt file contains the data: A, B, C, D
Excel, columns Col A Col B Col C Col D
I copy the data from the text file in my Excel file,
Col A receives data from A Text File
Col B receives the data B Text File
Col C C receives the data from the text file
Col D receives the data D Text file

Iteration 2:
Text file contains data: A1, B1, C1, D1
Excel, columns Col A Col B Col C Col D
I copy the data from the text file in my Excel file,
Col A receives the data A1 of the Text file
Col B receives the B1 data Text file
Col C C1 receives the data from Text File
Col D receives the data D1 Text file

Iteration 3:
Text file contains the data A2, B2, C2, D2
Excel, columns Col A Col B Col C Col D
I copy the data from the text file in my Excel file,
Col A receives the A2 data file Text
Col B receives the data from the text file B2
Col C receives the C2 data Text file
Col D receives the data D2 Text file

iteration n:
Txt file contains the data: An, Bn, Cn, Dn
Excel, columns Col A Col B Col C Col D
I copy the data from the text file in my Excel file,
Col A Year receives data from Text File
Col B receives the data Bn Text file
Col C Cn receives data from Text File
Col D receives the data Dn Text file


Problem: I can not seem to increment my lines to avoid overwriting the data in the first line
Col A receives data from A Text file instead of A (1 or 2 or 3 ... n)
Col B receives the data of the text file B instead of A (1 or 2 or 3 ... n)
Col C receives the C text file data instead of A (1 or 2 or 3 ... n)
Col D receives the data D Text file instead of A (1 or 2 or 3 ... n)

Re: compare : Excel data and those PDF

Posted: Thu Apr 16, 2015 12:18 pm
by denatora971
Hello,

Otherwise, here is a simple project that illustrates what I want to do.

Thank you a lot,

Re: compare : Excel data and those PDF

Posted: Thu Apr 16, 2015 12:32 pm
by odklizec
Hi,

OK, this project looks a bit better than the initial one you posted with missing data connector excel file ;) Anyway, the single recording in your test case contains too many steps and paths behind the repository elements are too easy to fail. I'm still not quite sure what you want to achieve, but I'm afraid, some user code may be necessary to achieve your goal?

Filling an excel file with data from data connector and doing it just via "recorded" actions looks like "mission impossible". It may work with some simple data connectors, with only few rows/columns, but I'm quite positive it will fail with so complicated excel like yours. I think you need to start with something simpler that should help you to gradually improve your Ranorex knowledge and skills. I don't want to sound too harsh, but you can't run before you learn to walk!

I would suggest you to start with splitting the recording to multiple logical units. Then clean-up each recording (use SetValue instead key sequences and unnecessary mouse clicks, minimize number of actions to bare minimum, etc...). Try to improve the repository, mainly make the paths less "hardcoded".

To be able to increment cell numbers and to avoid adding every single cell to repository, you will have to make the cells' paths more generalized with some indexes and then use "user code" to fill the appropriate cells based of actual data connector row number. As mentioned, doing what you want just with recorded actions would be a real pain and unmaintainable mess of actions and repo elements.

Re: compare : Excel data and those PDF

Posted: Thu Apr 16, 2015 1:34 pm
by denatora971
I understand, and I also think that I must go up in skill with simple things,
But I have not much time for now, I have to rise rapidly automating this procedure,
so if you can help me understand why I crashed every time the value of the first preceding cell? instead of incrementing the cells.
Thank you for your advice and support.