How to perform a “Ctrl + Left Click” action in Leapwork
How to perform a “Ctrl + Left Click” action in Leapwork
In Leapwork, there are scenarios where end-users are looking to perform the operation "Ctrl+ Left Click" so as to select multiple options in a list or for instance open the link in a new window.
There are multiple ways to achieve this in Leapwork with help of keystrokes as well as Run Web JavaScript building block (for web application only).
Users can use the “Press Key” block to keep the Ctrl button pressed with the “Click Image” block to click on the web element:
If the application is a web application, then one of the ways to achieve this is using the “Run Web Javascript” block to handle such scenarios by using dispatchEvent as below: ( ex- document.getElementsByClassName("RNmpXc")[1].dispatchEvent(new MouseEvent("click", {ctrlKey: true})); )
Leapwork users can also use the “Press Key” block to keep the Ctrl button pressed with the “Click Text” block to click on the web element:
Note:(Best Practice: Capture the Area in the Click Text block to search the text within that area)
For clarification, please contact our Priority Support.