Post
by krstcs » Fri Jul 11, 2014 1:46 pm
It very much depends on the tool.
There are two things that a test automation tool must do:
1. Manipulate UI objects (move the mouse, enter text, change attributes, etc.). This is what actually drives the tests.
2. Find or identify UI objects. This is the hard part.
With most tools, these two things are blended to a lesser or greater degree. There is no point in manipulating the UI if the tool can't tell what to manipulate. And there is no point in identifying the objects unless you can do something with them. So, they have to be done together.
With Ranorex, for manipulation, they use a couple of methods. For straight up mouse/keyboard interactions, they have created what is called a "filter driver" that sits between the OS and the actual mouse/keyboard driver. That allows Ranorex to control the mouse and keyboard without the OS really knowing the difference. This has to be done in low-level (usually C/C++, but possibly .NET, not sure with Ranorex) code. For UI manipulation, such as changing an attribute without using the mouse/keyboard, they just tell the OS to change the value (very technical stuff so I won't go deeper, would take all day...).
For identification, Ranorex tries to use Microsoft's automation framework in Windows or .NET applications, and they inject a module in Java and web browsers, that reads the structure and reports it back to Ranorex in a consistent manner. They use that info to make a hierarchical tree of the objects and their parent-child relationship. This can then be used, along with RanoreXPath (their version of XPath) to identify the path to an object and the attributes that Ranorex needs to use to make sure it has the right one. These modules and/or automation framework also report all the information about an object, the size, location, name, ID, automation properties, etc. that the object has.
Shortcuts usually aren't...