Selenium webdriver test on Canvas

2,263 views
Skip to first unread message

jpan

unread,
Sep 19, 2012, 7:39:55 PM9/19/12
to seleniu...@googlegroups.com
Hi, 

I'm trying to do a test on this Canvas tutorial site,  the code suppose to draw a line on the canvas element, but it doesn't work, any one has idea of this? Thanks a lot!   Jie



WebDriver driver = new FirefoxDriver();

driver.get("http://www.theautomatedtester.co.uk/demo1.html");

Actions builder= new Actions(driver);

WebElement canvas = driver.findElement(By.id("tutorial"));

builder.build();

builder.moveToElement(canvas, 100, 100)

.clickAndHold()

.moveByOffset(40, 60)

.release();

builder.perform();

Milkamal KR

unread,
Aug 13, 2014, 7:26:38 PM8/13/14
to seleniu...@googlegroups.com
HI,

Did you find a way to test canvas  ?

Thanks,

David

unread,
Aug 14, 2014, 9:39:52 PM8/14/14
to seleniu...@googlegroups.com
I believe canvas is HTML5 feature, correct? Selenium does not support much in terms of HTML5 functional automation. This includes drag & drop, to which what you are doing is quite similar. There's a workaround for HTML5 drag & drop, perhaps to a degree, that might be adaptable to solve your problem, but no guarantees. You'd have to figure it out yourself though.

Reply all
Reply to author
Forward
0 new messages