cancel
Showing results for 
Search instead for 
Did you mean: 

How to achieve multi select for html Combo box in BP

Anonymous
Not applicable
I am having a HTML combo box and I have to select multi values from it using BP, multi values could be selected by holding the CONTROL key and mouse click on that element. I have tried to achieve it as following but it does not work: Step 1: Activate Application Step 2: Select some value from combo box using write stage. Step 3: Send CTRL key. Step 4: Select another value from combo box using write stage. Step 5: Send CTRL key. Step 6: Select another value from combo box using write stage. and so on... We have spy combo box using HTML mode, above implementation output gives last element selected [it retains only latest selected value].
3 REPLIES 3

Denis__Dennehy
Level 15
If you are using the Global Send Key to send the CTRL key than that will not work - because you are effectively just pressing the control key once rather then keeping it held down. Instead try using the Control Down and Control UP key strokes available with send key events. Your flow would be something more like this: Step 1: Activate Application Step 2: Select some value from combo box using write stage. Step 3: Send ""{CTRL}"" using Send Key Events. The one thing to be careful with doing something like this is the risk that an exception occurs between CTRL down and CTRL up that could leave the control key in a down position. To mitigate this you should have an exception block around everything between the CTRL down and CTRL up and ensure a CTRL up is sent if a system exception occurs.

Anonymous
Not applicable
Thanks Denis for your suggestion. We tried the given key combination but web page is still not able to retain all the values.It only holds value from last Write stage . However we can verify that sending down ctrl key (pressing) and up ctrl key (releasing) is working in steps because if we don't send the up ctrl key in last stage then Robot machine behaves like someone has kept the ctrl key pressed. It seems BP's Write stage is not able to reproduce the behavior seen with Mouse Click on values in combo box when done manually by a human while keeping ctrl key pressed. We are using ""Global Send Key Event"" for pressing and releasing ctrl key.

Anonymous
Not applicable
Thanks Denis. It helps how to make CTRL key (press) working. Alternate way to achieve it is as following: Note : You have to spy the whole screen and related comboboxes using Accessiblity mode as well. Manual process: 1) Focus on html multi combo box. 2) Press ""Shift key + F8"", it will enable extended selection to select multiple values in combo box. 3) Use Down/Up arrow key to navigate desired element. 4) Press ""CTRL + Space Bar"" to select/deselect element in multi select box. BP implementation: Step 1: Activate Application using Navigate stage. Step 2: Use Read stage to get values from multi combo box in a Colection. (use HTML spy mode for the combobox) Step 3: Focus on target multi combo box. (use Accessiblity mode) Step 4: Enable extended selection to select multiple values in HTML combo box using navigate stage with Action ""Global Send Key Events"": {ShitKey} Step 5: Loop through the collection (from step 2) against the ""values to select"" and find out the position(index) for each element. Step 6: Using the position index navigate to the element (use down key) then select the element in combo box by sending key