Automating Multi-select dropdowns can be tricky, but with Leapwork you can automatically reproduce the same steps a human does to select multiple options, below are the examples to achieve this:
A user has a multi-select dropdown, for example, https://bootsnipp.com/snippets/Ekd8P, and the user wants to select two options - Cheese & Onions.
- Selecting one by one using multiple Click Web Element blocks:
- Selecting elements with one Click element and with a scroll:
- Open the URL and navigate to drop down control:
- Now Click on the drop-down control to expand it
- After that use the Find element to capture all elements in the dropdown, and make sure that the Use Occurrence option is selected to 'All' so that we can iterate through all options.
- Now capture one element using the 'Click Web Element' block and keep only the inner Label/element and replace the identifier text with a field (shown below)
- Now, joining Find Web Element with Click Web Element where Find Web Element is connected as a source to Click Web Element and replacing Field1 with dynamic data will allow the user to click dynamically in iteration. If the drop-down has a scroll control then you can use 'Scroll to find' with the option as 'Down' (currently its 'None') in the click web element block to click deep in the dropdown.
- Here is the result
For any clarification, please contact our Priority Support.