Forum Discussion
The lastest function I've added finds all the properties for each listitem but it still won't click the actual item.
The screen shots are the errors and the items found using the debug mode.
Thanks
What it looks like is that, after you click on the control, the list items are not necssarily visible on screen. Before you click on them, try calling "scrollIntoView" on the object (I'm assuming this is a web application). That will make sure that it is visible on screen before any attempts to act on it are executed.
- SaravanaKumar_N6 years agoContributor
Then we have to create our own scroll method.
This might work for you, give it a try. Pass the objects - dropdown and listItem to be selected to this method. You may also have to name map your vScroll bar accordigly else update the code as per your need.
function scrollIntoView(dropdown, listItem) { while ( (dropdown.Height < (listItem.Top + listItem.Height)) && ((dropdown.vScroll.Pos + 5) < dropdown.vScroll.Max)) { dropdown.vScroll.Pos += 5; Delay(100); } while (listItem.Top < 0 && (dropdown.vScroll.Pos - 5) > 0) { dropdown.vScroll.Pos -= 5; Delay(100); } }
- russelld6 years agoContributor
No, "scrollIntoView" is not available. Its a desktop application not a web application.
- SaravanaKumar_N6 years agoContributor
So now you are able to find the item. And did you get a chance try this way..
Can you check ListItem object has any methods like 'Focus' ? (you can check in the object browser)
If available, you can do..
listItems[i].Focus();
Delay(500); // delay may be needed, if not remove it
listItems[i].Click();
- russelld6 years agoContributor
Thanks
Focus is availble with the parent two levels up. The attached is the properties I got to work with
Related Content
- 12 months agolokwk216
- 11 years agoRavik
- 6 years agofunmay
- 12 years agositasrikanth
Recent Discussions
- 2 days agoGane195