Page 1 of 1

Unable to find few list item in combo field

Posted: Thu Apr 07, 2011 10:19 pm
by Saha
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

Re: Unable to find few list item in combo field

Posted: Fri Apr 08, 2011 6:31 am
by Support Team
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

Re: Unable to find few list item in combo field

Posted: Fri Apr 08, 2011 4:29 pm
by Saha
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

Re: Unable to find few list item in combo field

Posted: Mon Apr 11, 2011 12:33 pm
by Support Team
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

Re: Unable to find few list item in combo field

Posted: Thu Apr 14, 2011 3:08 pm
by Saha
Thanks for your reply.
This issue is fixed now.