Page 1 of 1

How to store the values from a web table in an excel file

Posted: Tue Aug 05, 2014 2:41 pm
by Gergana
Hi All,

I have the following problem:
I need to get the values from a web table (located in site 1) and store it in an excel file. Then such data to be compared if they are equal with the data from a web table located in a different web site (site 2).
Can somebody help me?

Thanks in advance!

Best Regards,
Gergana

Re: How to store the values from a web table in an excel file

Posted: Wed Aug 06, 2014 12:51 pm
by Support Team
Hi Gergana,

In order to write data into an Excel file you can use the .NET Framework. There are already some posts in our forum treating this topic.

http://www.ranorex.com/forum/writing-ex ... t1605.html
http://www.ranorex.com/forum/how-to-wri ... t3258.html
http://www.ranorex.com/forum/my-excel-f ... t3265.html

I hope this helps.

Regards,
Bernhard

Re: How to store the values from a web table in an excel file

Posted: Thu Aug 07, 2014 12:02 pm
by Gergana
Hello,

Thank you for your answer.
The following error message is displayed in case i try to use some of the examples from here: http://www.ranorex.com/forum/my-excel-f ... t3265.html
"Failed to update code for '<Project_Full_Path>'. The user code class has compile errors - <Project_Full_Path>"
Do you know what is the reason to receive this error?

Thanks in advance.

Best Regards,
Gergana

Re: How to store the values from a web table in an excel file

Posted: Thu Aug 07, 2014 1:08 pm
by krstcs
You probably have a compile error in your user code. You need to check the user code for errors (red underlines) and fix them.

Re: How to store the values from a web table in an excel file

Posted: Thu Aug 07, 2014 2:05 pm
by Gergana
Hi, Yes I find the error. Thanks!

But now I have another problem. Is it possible to get an element with inner text by XPath?
Could you please give me an example how it can be done?
Also when we try to use an element should it be added in the repository? Can it be done by coding without using repository? Could you please give me an example, too?

Thank you in advance.

Best Regards,
Gergana

Re: How to store the values from a web table in an excel file

Posted: Thu Aug 07, 2014 2:22 pm
by krstcs
1. Yes, it is possible to get an element based on the innertext attribute. Use the "[@InnerText='<Your InnerText>']" format.

2. You can find elements without using the repository, however in my opinion you gain more by using the repository than you would by not using it. You can find information on the Ranorex API here: http://www.ranorex.com/Documentation/Ranorex/

Re: How to store the values from a web table in an excel file

Posted: Thu Aug 07, 2014 2:42 pm
by Gergana
Hi krstcs,

Thank you for your answer.
Could you please give me an example with working code? All day today me and my colleague working on this but we were not able to fix our issue. We researched in Google for some example, but they didn’t help us. Maybe there is some specific for Ranorex code.

Look forward to hearing from you.

Best Regards,
Gergana