compare : Excel data and those PDF

Ask general questions here.
denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

compare : Excel data and those PDF

Post by denatora971 » Mon Mar 30, 2015 9:26 am

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?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: compare : Excel data and those PDF

Post by odklizec » Mon Mar 30, 2015 1:42 pm

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
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Mon Mar 30, 2015 2:30 pm

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: compare : Excel data and those PDF

Post by odklizec » Mon Mar 30, 2015 2:36 pm

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Mon Mar 30, 2015 3:06 pm

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
Attachments
excelTest.PNG
ExcelTest
excelTest.PNG (5.45 KiB) Viewed 4020 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: compare : Excel data and those PDF

Post by odklizec » Tue Mar 31, 2015 8:38 am

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?
Attachments
ExcelDataConnector.zip
(18.22 KiB) Downloaded 197 times
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Tue Mar 31, 2015 9:02 am

Ok, I will test,
thank you very much.

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Supply Data in Excel line / line (Pb increment)

Post by denatora971 » Thu Apr 16, 2015 11:20 am

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.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: compare : Excel data and those PDF

Post by odklizec » Thu Apr 16, 2015 11:23 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Thu Apr 16, 2015 11:47 am

you can retrieve the file here

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

Id : ranorex
mp : ranorex

Thanks,

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Thu Apr 16, 2015 11:48 am

its my project

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Thu Apr 16, 2015 12:01 pm

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)

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Thu Apr 16, 2015 12:18 pm

Hello,

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

Thank you a lot,
Attachments
TestRanorex.zip
My Sample project for illustration
(700.29 KiB) Downloaded 117 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: compare : Excel data and those PDF

Post by odklizec » Thu Apr 16, 2015 12:32 pm

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

denatora971
Posts: 12
Joined: Mon Mar 30, 2015 8:57 am

Re: compare : Excel data and those PDF

Post by denatora971 » Thu Apr 16, 2015 1:34 pm

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.