The DragNDropLibrary collection provides the functionality to move UI elements with drag and drop during a test.
DragNDropLibrary methods
To use this functionality, add the method to your recording module. For more information, see Using the User Code Library.
DragAndDrop
This method picks the source element, drags it to the target element and drops it there. It requires the following arguments:
- Adapter source: The repository item representing the UI element you want to move.
- Adapter target: The repository item representing the destination where you drop the source element.
Example
Consider a scenario where you move a file named text1.txt from a local folder to a cloud storage folder like Dropbox.
Ensure you store both the text1.txt file (1) and the destination drop area (2) as repository items in your solution.
Result
During execution, the method drags the text1.txt file and drops it onto the designated area in the Dropbox window. The file successfully uploads and the test continues to the next step.