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

Class library usage, coding and language questions.
Gergana
Posts: 6
Joined: Fri Jul 25, 2014 1:58 pm

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

Post by Gergana » Tue Aug 05, 2014 2:41 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Wed Aug 06, 2014 12:51 pm

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

Gergana
Posts: 6
Joined: Fri Jul 25, 2014 1:58 pm

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

Post by Gergana » Thu Aug 07, 2014 12:02 pm

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

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Thu Aug 07, 2014 1:08 pm

You probably have a compile error in your user code. You need to check the user code for errors (red underlines) and fix them.
Shortcuts usually aren't...

Gergana
Posts: 6
Joined: Fri Jul 25, 2014 1:58 pm

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

Post by Gergana » Thu Aug 07, 2014 2:05 pm

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

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Thu Aug 07, 2014 2:22 pm

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/
Shortcuts usually aren't...

Gergana
Posts: 6
Joined: Fri Jul 25, 2014 1:58 pm

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

Post by Gergana » Thu Aug 07, 2014 2:42 pm

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