About Article:
This article will cover how to use co-ordinates to click on elements inside a canvas.
Description:
Virtuoso can not identify elements inside a Canvas object on a webpage.
As such the only way to interact with objects on a canvas is by using mouse co-ordinates, but it can be difficult to calculate the co-ordinates.
Solution:
How to calculate the position:
- Compute the coordinates from the top left corner of the canvas (for example 383, 285) or relative position from an existing element.
- Then use the mouse move to NLP for absolute movement, or mouse move over NLP followed by mouse move by for relative movement.
- For absolute movement
- mouse move to 383, 285
- For Relative movement
- Mouse move over “element”
- Mouse move by 383, 285
- For absolute movement
- Perform a Mouse click.
- E.g. Mouse Click
Please refer below link for more information on mouse actions:
https://docs.virtuoso.qa/guide/making-the-most-of-virtuoso/virtuoso-tests.html#mouse-actions
Comments
0 comments
Please sign in to leave a comment.