Hi Telerik,
I have been trying to figure out a way to create automated tests for our application that uses a gojs html 5 canvas. I have noticed two ways so far:
1. Click on specific points (ActiveBrowser.Desktop.Mouse.Click(MouseClickType.LeftClick, 930, 405);). This seems to work provided that the browser always opens in full screen and that the elements in the canvas never change meaning that the tests might become obsolete so I don't believe it being the best approach.
2. There seems to be an HtmlCanvas class that I can't seem to find much information or examples on. I have tried the following:
HtmlCanvas canvas = Find.AllByTagName.FirstOrDefault(w => w.TagName ==
"canvas"
);
var brandNode = canvas.ChildNodes.FirstOrDefault(w => w.TextContent ==
"Brand"
);
HtmlDiv div = brandNode;
div.Click();
This code gives me the following errors:
- 'ArtOfTest.WebAii.Core.Find.AllByTagName(string)' is a 'method', which is not valid in the given context
- Cannot implicitly convert type 'ArtOfTest.WebAii.ObjectModel.Element' to 'ArtOfTest.WebAii.Controls.HtmlControls.HtmlDiv'
Is my approach maybe wrong? What is the best way to resolve this? Where can I get more information regarding accessing the canvas on a browser to generate automated tests?
Thanks in advance