How to get the absolute path for the tryfindsingle ? : Automation API

How to get the absolute path for the tryfindsingle ?

Class library usage, coding and language questions.

How to get the absolute path for the tryfindsingle ?

Postby venkatesh526 » Mon Aug 30, 2010 11: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 11:26 am

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

Postby venkatesh526 » Mon Aug 30, 2010 12:27 pm

Please team help me its ver y urgent. :cry:
venkatesh526
 
Posts: 4
Joined: Mon Aug 30, 2010 11:26 am

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

Postby Support Team » Mon Aug 30, 2010 12:54 pm

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
User avatar
Support Team
Site Admin
 
Posts: 4297
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests