Selecting Text : Automation API

Selecting Text

Class library usage, coding and language questions.

Selecting Text

Postby jainaakash » Wed Jun 30, 2010 3: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
jainaakash
 
Posts: 48
Joined: Thu Jun 10, 2010 1:06 pm

Re: Selecting Text

Postby Support Team » Wed Jun 30, 2010 3:49 pm

Hi,

Please take a look to our Documentation
http://www.ranorex.com/support/user-gui ... html#c1875
or read following post
selecting-an-item-from-a-combobox-t1346.html?hilit=Combobox

Regards,
Peter
Ranorex Support Team
User avatar
Support Team
Site Admin
 
Posts: 4845
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: Selecting Text

Postby dal » Thu Jul 01, 2010 7: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
dal
 
Posts: 72
Joined: Thu Jun 24, 2010 9:59 am

Re: Selecting Text

Postby jainaakash » Thu Jul 01, 2010 1:06 pm

Thanks Guys.

Got resolved as:
txtObj.MoveTo
txtObj.Click

Regards,
Aakash
jainaakash
 
Posts: 48
Joined: Thu Jun 10, 2010 1:06 pm


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests

cron