Can anyone tell me how test automation tools work

Ask general questions here.
User avatar
testautomator
Posts: 67
Joined: Fri Oct 25, 2013 6:37 am
Location: Bangalore, India

Can anyone tell me how test automation tools work

Post by testautomator » Fri Jul 11, 2014 10:42 am

Hi all,
I have always wondered how a test automation tool works internally. I know there might be some trade secrets but apart from that is there any information on this?
I have searched internet but its been too difficult to find answers. I mean how does it identify objects and how it starts to work on them. Its a vague question. Appreciate if anyone can explain :)

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Can anyone tell me how test automation tools work

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...

User avatar
testautomator
Posts: 67
Joined: Fri Oct 25, 2013 6:37 am
Location: Bangalore, India

Re: Can anyone tell me how test automation tools work

Post by testautomator » Fri Jul 11, 2014 2:23 pm

@krstcs
Thank you for giving some insights. Any book or any website there is to take a deeper look?
Its just too weird that I cant find a youtube video or a website. Or I might have missed one :)

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Can anyone tell me how test automation tools work

Post by krstcs » Fri Jul 11, 2014 4:33 pm

I don't have any suggestions on books or sites specifically, all of my information is based on years of experience with software test automation tools and Java/.NET development. There aren't many resources for how it happens because, as you said in your first post, much of it is protected by the creators.

Ranorex is good for understanding, if you are willing to get into their API and code. You will start to see patterns and structure after a bit.

There are open-source tools out there such as Selenium, Watir/Watin/Watij that you might also check out. They are WEB-based tools, so some of the low-level mechanics are not needed, but looking at them will help you understand more about how it works. I would suggest Watin specifically since it is .NET based (like Ranorex). The big problem with them is that you get what you pay for. They are good tools for the most part, but support is community based only, and if people stop using them, they stop contributing, so the product dies. While that could happen with Ranorex (or QTP, etc.) it is less likely with good tools because those of us who use them are still paying to keep the company in business and doing what they are good at.
Shortcuts usually aren't...

User avatar
testautomator
Posts: 67
Joined: Fri Oct 25, 2013 6:37 am
Location: Bangalore, India

Re: Can anyone tell me how test automation tools work

Post by testautomator » Mon Jul 14, 2014 5:04 am

Thanks..for the suggestions. Ok Watin and Selenium. Will take a look at those.