Selecting Text

Class library usage, coding and language questions.
jainaakash
Posts: 48
Joined: Thu Jun 10, 2010 12:06 pm

Selecting Text

Post by jainaakash » Wed Jun 30, 2010 2:21 pm

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

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

Re: Selecting Text

Post by Support Team » Wed Jun 30, 2010 2:49 pm

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

dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Re: Selecting Text

Post by dal » Thu Jul 01, 2010 6:13 am

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

jainaakash
Posts: 48
Joined: Thu Jun 10, 2010 12:06 pm

Re: Selecting Text

Post by jainaakash » Thu Jul 01, 2010 12:06 pm

Thanks Guys.

Got resolved as:
txtObj.MoveTo
txtObj.Click

Regards,
Aakash