How to handle Canvas Element ? | Selenium Forum
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("CanvasAnimate"));
Actions builder = new Actions(driver);
builder.moveToElement(element).clickAndHold().moveByOffset(0, 0).moveByOffset(8, 8)

Let me know for more info



Ashish Replied on 27/03/2021

I think this is not possible with selenium