I have a canvas element (Width: 720, Height : 174). This canvas has 16 parts. I tried
Actions.moveToElement(we,(720/16)*3,1).click().perform();
I want it to click in part 3 of the canvas, but it always clicks in the first part. Please help!
Try
Actions.moveToElement(we,0,0).moveByOffset((720/16)*3,1).click().build().perform();
For getting co-ordinates of the elements inside canvas tag use any online ruler
Actions clickAt = new Actions(d);
clickAt.moveToElement(d.findElement(By.xpath("your canvas id here")), 60, 30).click();
clickAt.moveToElement(d.findElement(By.xpath("your canvas id here")), 90, 30).click();
clickAt.build().perform();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With