cancel
Showing results for 
Search instead for 
Did you mean: 

Best practice - Surface Automation & drop-down list

MariaKihlberg
Level 4
Hi, I am using surface automation in an application where I need to work with a drop-down list. I wonder if anyone has some input on best practice for developing this type of solution? Currently, I have built it with dynamic regions and increminting the Y-values by using a calculation stage each time I need to move down the list. What I am more uncertain about is recognizing if 'rolling down' is required, as well as recognizing when the drop-down list ends and all cases have been worked. Anyone with input on this? Br, Maria
4 REPLIES 4

hassan.chaudhry
Level 3
Once you've clicked on the list, you can try sending keys and either sending ""down"" to allow you to scroll or if the list allows it you can type the item you're looking for and this might identify the item also. Hopefully this helps.

Hi Hassan, Thanks for your reply. Sending the 'down' key is working for me, but what I am most concerned about is actually finding a way of deciding when the end of the list has been reached. Do you have any suggestions here? My own thoughts have been: 1. List has ended once the same task appears twice (compare with previous value) BUT I cannot use this option, as this is not a guarantee that we are at the end of the list... Sometimes, an identical task will appear twice in the list. Would appreciate input on this. Br, Maria

TomBlackburn1
Level 7
Maria, If your list has an slider, you can recognize when the slider has reached the bottom. I usually pre-capture the image of the slider at the bottom, then after each iteration, read this region and compare against the pre-captured image. If your list does not have a slide then you will need to use an alternative method: 1) You could possibly extend the option you mentioned above to compare if the same task appears 3 times. 2) You could set a maximum amount to press the down key (usually this could be set to the total amount of items in the drop down list. Hopefully this is a static amount) - Tom.

Denis__Dennehy
Level 15
The dropdowns in each application is slightly different so experimentation is key for a new applicaiton. There is a section in the latest Surface Automation training about Combo Boxes that gives 4 different techniques that most commonly works. What most often works for me is to press the first letter of what I need to input, then press down keys until I get to the value I want (reading back with Character Matching to check each value). You will have finished your search when Character Matching shows the value starts with a different letter.. or the value no longer changes.