How to click on specific element in canvas by its coordinates (using WebDriver)?
问题 I have a canvas element on my page and I want to click on specific (x, y) coordinates in this canvas. I use watir-webdriver: element = browser.driver.find_element(:id, 'canvas') browser.driver.action.move_to(element).move_by(x, y).click().perform But this code just clicks on the center of the canvas, not the specified (x, y) coordinates. What is wrong with it? UPD: So now I use this code: element = browser.driver.find_element(:id, 'canvas') browser.driver.action.move_to(element, x, y).perform