Page 1 of 1

Selecting Text

Posted: Wed Jun 30, 2010 2:21 pm
by jainaakash
Hi Team,

In our AUT, the listitems under the combobox are recognised as Text. (listitem/text[@name='<somename>'].

I want to select a text and then click on the text. Simply textObj.click does not work all the times. If the item is down in the list, it fails to click on the text. Can you please help.

Thanks and Regards,
Aakash

Re: Selecting Text

Posted: Wed Jun 30, 2010 2:49 pm
by Support Team
Hi,

Please take a look to our Documentation
http://www.ranorex.com/support/user-gui ... html#c1875
or read following post
http://www.ranorex.com/forum/selecting- ... t=Combobox

Regards,
Peter
Ranorex Support Team

Re: Selecting Text

Posted: Thu Jul 01, 2010 6:13 am
by dal
Hi,

You can try with the following code as well...

'Item1 - Is the one you want to select from listBox
Dim rxPath As String = String.Format(".//listitem[@accessiblename='{0}']", "Item1")
Dim item As Ranorex.ListItem = Nothing
' Searching for list item based on the created RanoreXPath
Dim found As Boolean = repo.ContainerSelectboxItem.Self.TryFindSingle(rxPath, item)
If found Then
item.[Select]()
item.Click()
Else
Report.Error("Item1 not selected")
End If

Thanks,
Dalsingh

Re: Selecting Text

Posted: Thu Jul 01, 2010 12:06 pm
by jainaakash
Thanks Guys.

Got resolved as:
txtObj.MoveTo
txtObj.Click

Regards,
Aakash