How to handle Canvas Element ? | Selenium Forum
S
sghatigar Posted on 25/03/2021

Hi Ashish, 

Refer attachment before reading the below section

I am automating the canvas elements through selenium + JAVa but I am unable to move the lines. How to find the Coordinates of Canvas elements?

 There are 2 Lines on the Graph, I am able to move only one line (i.e. red color line) through the below code. But I am unable to move another line. (Blue one). 

WebElement element = driver.findElement(By.id("CanvasAnimate"));
Actions builder = new Actions(driver);
builder.moveToElement(element).clickAndHold().moveByOffset(0, 0).moveByOffset(8, 8)
.release().perform(); 

Let me know for more info

Thanks

Shripad


A
Ashish Replied on 27/03/2021

I think this is not possible with selenium