简体   繁体   中英

Creating html canvas automation tests with Test Studio

I am currently investigating Telerik Test Studio to generate automated tests and 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 to use it as follows but it does not seem as if I can access the elements or text in the canvas this way either:

    HtmlCanvas canvas = new HtmlCanvas(ActiveBrowser.Find.AllElements().FirstOrDefault(w => w.TagName == "canvas"));

What would be the best way to approach this scenario? Where is a good place to find more information and examples regarding Test Studio HtmlCanvas?

I suggest that you look at the http://gojs.net/latest/extensions/Robot.html sample, and then make use of the http://gojs.net/latest/extensions/Robot.js extension in your test system.

Note that the coordinates used by Robot are in GoJS document coordinates, not screen coordinates or any particular HTML element's coordinates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM