Dealing with Canvas Elements
The items inside a
<canvas> element do not have their own Locators.
In order to precisely click on a certain position in a
<canvas> element, you have to provide the offset, by using the
Click with Offset action:
Relative Position represents the number of pixels to the right and down, starting from the top left corner of your
Since there is no way to retrieve the coordinates of a position from a
<canvas> element, you can use an
<canvas> element from the top left corner to the position which you are targeting.
This can help you identify the coordinates of a position from a
canvas = document.querySelector("#map-page > div > canvas"); ctx = canvas.getContext("2d"); ctx.moveTo(0,0); ctx.lineTo(190,320); ctx.stroke();