I want to click on a specific location of my canvas , so I wrote the following Protractor code:
var canvas = element(by.id("canvas")); var clickCanvas = function(toRight, toBottom) { browser.actions() .mouseMove(canvas, -toRight, -toBottom) .click(); }
toRight / toBottom is the number of pixels where a click should be made, relative to the upper left corner of my canvas.
However, the click does not seem to be executed at the given coordinates. I got a snippet from a related question about exchanging quality assurance and software testing stacks.
Can you confirm that this fragment works?
Can you suggest alternatives?
source share