Read tdTag value

Ranorex Spy, Recorder, and Studio.
erezc
Posts: 2
Joined: Tue Mar 12, 2013 2:34 pm

Read tdTag value

Post by erezc » Tue Mar 12, 2013 4:17 pm

Hi All,

I am taking my first steps into Ranorex :oops: and would like to process a read a value taken from the "SPY" path:
"/dom[@domain='IP Address']//div[#'div1']/iframe//tr[#'IdDefLanIp']/td/table/tbody/tr/td[3]"

I looked over the posts with no success.

Note: I am writing at c# environment

Any answer will be welcomed.

Thank!

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Read tdTag value

Post by Ciege » Tue Mar 12, 2013 6:34 pm

So if you know the path to the TdTag you need to set a variable to that element. Then you can access the appropriate attribute of that element, such as the innertext attribute or whatever holds the data you want. You can determine the proper attribute by having a look at the element through RanorexSpy.

Something *LIKE* the following. This is quick and dirty with no error checking and is just using your hard coded path...

Code: Select all

Ranorex.TdTag MyTdTag = Host.Local.FindSingle<Ranorex.TdTag>("/dom[@domain='IP Address']//div[#'div1']/iframe//tr[#'IdDefLanIp']/td/table/tbody/tr/td[3]", 30000);

string MyTdTagValue = MyTdTag.innertext.tostring();

If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

erezc
Posts: 2
Joined: Tue Mar 12, 2013 2:34 pm

Re: Read tdTag value

Post by erezc » Wed Mar 13, 2013 10:43 am

Great!

Thank you.