Forum Discussion
Does it throw any error message?
I can see the methods available for dropdown item in your previous screenshots. Can you share the properties and methods shown for the ListItem?
Also I noticed there is a 'Value' property at your dropdown. If your tests does not care about the way how the dropdown value is set.
You can try something like this...
ddlVehicle.Value = menuItem;
I would suggest this only if you could not find any other option to set the value and if your test does not care the way the value is set.
See the following attachments...Thanks
- SaravanaKumar_N6 years agoContributor
Slightly confused now. Are you facing the issue while clicking the list item from the dropdown or while clicking the dropdown itself?
Error - "There was an attempt..." looks to be for Dropdown click action. If so please check whether all okay with your mapping for the dropdown.
Also, in your function you are checking for listObject.Exists, so you would not get 'Object does not exist' error message for the list item. I expect you should just get that Log.Message - drop down not clicked.
- russelld6 years agoContributor
The dropdown gets clicked but it can't find the 'listitem' because of the scrollbar.
- SaravanaKumar_N6 years agoContributor
Got you! We should scroll in to that ListItem before clicking it.
'ClickItem' method will normally would handle those cases. But here it would be slightly tricky.
Can you check ListItem object has any methods like 'Focus' ?
If available, you can do..
listObject.Focus();
Delay(500); // delay may be needed, if not remove it
listObject.Click();
One more solution may work.
In your application, if you manually type in the dropdown and it can select the item you need. Then instead of doing all these actions, we can just do...
dropDown.Keys(menuItem)
Related Content
- 12 months agolokwk216
- 11 years agoRavik
- 6 years agofunmay
- 12 years agositasrikanth
Recent Discussions
- 3 days agovladd1