cancel
Showing results for 
Search instead for 
Did you mean: 

Send Keys to select multiple table results

MikeThorpe
Staff
Staff
Hi all. I€™ve got what is probably a rookie question around Send Keys that I€™m hoping someone can help with. I€™m interacting with a List Box that contains around 100 items in. It is scrollable. I need to select multiple items within the table €“ I will know what these values are when I start the process (as input parameters). As a human, I would navigate to the box, select €˜Product 1€™ then hold shift and select €˜Product 2€™, then €˜Product 3€™ etc until I had selected all relevant products . A screenshot of what I€™m looking to do is below, lines blanked out but you can probably get the jist of it. The issue I€™m having is with the structure that I need to use and whether I do this all within a single navigate stage or multiple. In addition, the values that I need to select will be contained within Data Items. I believe my structure will be something along the lines of ; Global Mouse Click Centre on Product 1 Select Shift Global Mouse Click Centre on Product 2 etc So the structure would look something like this €“ €œ+, [Product 1]€, then click on [Product 2] etc. However when I run the process the products selected earlier don€™t remain highlighted. Could someone please advise the best way to do this? Is Send Keys the best way? Thanks Mike
2 REPLIES 2

Juan_LuisTrelle
Level 4
I would use space bar instead global mouse click. You probably can navigate with Arrows and Select items with Ctrl + "" "" (space bar). I thing something like this:   1- Set the focus on first element 2- Check if item must be selected 3- If affirmative, Send Global Keys ""^ "" (^ means control and the white space is like pressing space bar) 4- Send Global Keys ""{DOWN}"" 5- Go step 2 and repeat until the end.   Hope it helps

John__Carter
Staff
Staff
Hi Michael - try Global Send Key Events. It's the most basic keystroke option where you have to have specify up and down strokes, such as ""{SHIFT}ello"" for Hello. One of the pitfalls of GSKE is that you can 'glue down' a key if you get the syntax wrong, but in your case this might be an advantage. What you could try is something like 1) shift down, 2) click, 3) click, 4) shift up. You'll need pauses between these steps - if you have v6 you will be able to put these in one Navigate and specify a small pause in between. Or, you could use multiple navigates with tiny wait stages in between. The pauses stop the object executing the steps too fast.