Unable to find few list item in combo field

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Saha
Posts: 39
Joined: Tue Mar 01, 2011 6:20 pm

Unable to find few list item in combo field

Post by Saha » Thu Apr 07, 2011 10:19 pm

Hi,

I have these code to select values from a dropdown. It works perfectly in most of the cases. Only failing for certain items . I am able to see these items in the dropdown, but not sure why ranorex is not able to find.
I have also noticed that missing item in the 2nd item in the dropdown list.
Please help.

Here is my code
-------------
isElementFound = webDoc.TryFindSingle(".//select[@id~'.*" & elementName & "$']", Adapter.DefaultSearchTimeout, element)
If (isElementFound) Then
element.Click
isLookupFound = Host.Local.TryFindSingle("/container[@caption='selectbox']/listitem[@accessiblename='" & lookupItem & "']", Adapter.DefaultSearchTimeout, item)
If (isLookupFound) Then
item.Click
Keyboard.Press("{Tab}")
Else Report.Failure("Combo value not found."&lookupItem)
End If
Else Report.Failure("Element not found :" &fieldName)
End If

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

Re: Unable to find few list item in combo field

Post by Support Team » Fri Apr 08, 2011 6:31 am

Hi,

Your code looks ok and should work always, expect the ListItem.click().
Please add ListItem.Focus() before you click the item, this line of code ensures that the item is reachable/viewable for Ranorex.
If that doesn't help, could you please post us a Ranorex Snapshot of the combobox and the listitems to check if there are some special items inside the combobox.
How to create a Ranorex Snapshot

Thanks in advance.

Regards,
Peter
Ranorex Team

Saha
Posts: 39
Joined: Tue Mar 01, 2011 6:20 pm

Re: Unable to find few list item in combo field

Post by Saha » Fri Apr 08, 2011 4:29 pm

Hi Peter,

Thanks for your reply. I have added listItem.Focus() now before 'ListItem.Click().
It works fine, I am not getting any more list item not found issue. But I am facing another issue.
I am not able to see the selected listitem in UI, I am always able to see only default value.

My design was, I should be able to select each item from the dropdown and tab out and comeback again to the same field and select another value from the dropdown.
Am I missing something here?

Thanks for your help.
Saha

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

Re: Unable to find few list item in combo field

Post by Support Team » Mon Apr 11, 2011 12:33 pm

Hi,

can you please provide us a snapshot file of your application under test?
Following link will show you how to generate such a snapshot file:
http://www.ranorex.com/support/user-gui ... files.html

To track a list item of a combobox you have to use the instant tracking machsnisms of our product.
Have a look at following link, which explains you how instant tracking works:
http://www.ranorex.com/support/user-gui ... html#c3181

Regards
Tobias
Support Team

Saha
Posts: 39
Joined: Tue Mar 01, 2011 6:20 pm

Re: Unable to find few list item in combo field

Post by Saha » Thu Apr 14, 2011 3:08 pm

Thanks for your reply.
This issue is fixed now.