I have a canvas inside a window. The window is full screen, but the canvas is not the full size. I want to click a specific position in canvas so I use bellow:
Actions action = new Actions(driver).moveToElement(canvas, 0, 0).moveByOffset(849,341).click();
WebElement iframe = driver.findElements(By.tagName("iframe")).get(0);
driver.switchTo().frame(iframe);
WebElement canvas = driver.findElements(By.tagName("canvas")).get(0);
System.out.println(canvas.getSize().width/2); // -> returns 849
System.out.println(canvas.getSize().height/2); // -> returns 341
The problem is, the specific position isn't clicked and I don't know where is clicked just by using the code above. I've used Page Ruler to locate pointer but it didn't work in this situaion.
I'm hoping there is a solution which will highlight or show the location of pointer.