How to get the absolute path for the tryfindsingle ?

Class library usage, coding and language questions.
venkatesh526
Posts: 4
Joined: Mon Aug 30, 2010 10:26 am

How to get the absolute path for the tryfindsingle ?

Post by venkatesh526 » Mon Aug 30, 2010 10:33 am

Hi,
I am happy to see your quick responses for the problems which was faced by the users. I am having a problem. I am using TryFindSingle to select the path and after that i am selecting the some check boxes.

Here is my code. There are so many divtag's in str_1 but each divtag has the same number of checkboxes.
So if a_found is f=giving me path like ("/dom......../div/div/div/table/tbody/tr/td/a[.....]")

Dim str_1 as String = "/dom[@domain......"
Dim child_atag As String = ""+str_1+"table/tbody/tr/td/a[@InnerText='"+item.ToString+"']"
Dim rxpath as String = child_atag.ToString
Dim a_found As Boolean =main_divtag.TryFindSingle(rxpath,item1)
If a_found Then
Dim child_alt As String = ""+str_1+"table/tbody/tr/td/a/img[@Alt='Expand "+item.ToString+"']"
Dim iteeem as Ranorex.ImgTag = Nothing
Dim elem As Boolean = main_divtag.TryFindSingle(child_alt,iteeem)
If elem Then
iteeem.PerformClick()
Delay.Milliseconds(3000)
return iteeem.GetPath().ToString
Else
Dim child_altimg as String = "./img[@Alt='Collapse "+item.ToString+"']"
Dim iteem as Ranorex.ImgTag = Nothing
Dim elem1 As Boolean = main_divtag.TryFindSingle(child_altimg,iteem)
If elem1 Then
msbx(iteem.getpath().tostring) -----> ( this is showing only the img tag's( last node path) not full path)
return iteem.GetPath().ToString
Else
'Error
End If

venkatesh526
Posts: 4
Joined: Mon Aug 30, 2010 10:26 am

Re: How to get the absolute path for the tryfindsingle ?

Post by venkatesh526 » Mon Aug 30, 2010 11:27 am

Please team help me its ver y urgent. :cry:

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to get the absolute path for the tryfindsingle ?

Post by Support Team » Mon Aug 30, 2010 11:54 am

Sorry, but I don't know what the problem is. Element.GetPath and Adapter.GetPath always return the absolute path of the element; i.e. "iteem.GetPath().ToString()" should return the "full" (=absolute) path of the item.

Can you, please, describe in detail what the output of your program is right now and what you would expect it to be?

Regards,
Alex
Ranorex Team
.
Image