Come let us explore together…

Archive for March, 2011

Starting with TestComplete and Automation?


Hi,

After posting few articles in TestComplete I still wonder whether I have explained how to start with TestComplete and basically automate an application. This article might be little basic or late but I am publishing it before is too late.

How to start exploring TestComplete? What are the TestComplete resources available for a beginner which helps one to master it? How to automate an application? – These are the few questions I faced

TestComplete is proprietary test automation tool owned by Smart Bear. This tool is available for trail with 30 days for beginners.

  • Once you installed TestComplete (must include ‘Sample Scripts’ during install) in your machine, navigate to the folder C:\Documents and Settings\All Users\Documents\TestComplete X Samples. Here you can find the set of sample projects available for all the supported languages in TestComplete.
  • The best way to start exploration is to understand sample exercises/scripts. The scripts folder contains sample scripts for all the topics in TestComplete and other folders have supporting applications for the test projects.
  • Use support from Smart Bear and refer articles, screen casts and blog entries.
  • Best practice is to as you learn, share your findings / workaround / issues / doubts to the community or within your team where you can get clarified and be clearer on the topics you have explored.

Someone might feel like – Not enough time to go thru all the resources for understanding? Just start to automate a small application. You will learn as it on the go. (But this is recommended if you have prior experience in Test Automation!!!)

To start with, take a small scenario like editing a notepad and saving (or) automating the windows calculator. Straightaway go for recording the actions on the application and playback it to verify the test running again!!!

By this approach you will understand how TestComplete reacts to your actions to achieve the scenario if dive in to the recorded test scripts.

Regarding this, I have written an entry in TestComplete blog space on ways to speed up our automation efforts and few framework related points as “Rapid Test Automation using TestComplete”.

If you are already known with some of test automation tools, make a comparative or case study to understand exactly what TestComplete will do or not.

Once we are familiar with TestComplete as an automation tool, try to concentrate on any one of the scripting language it supports. Just for your reference – It supports 5 scripting languages: Jscript, VBScript, C# script, C++ script and Delphi script.

You may refer these links for your exploration,

Jscript – http://msdn.microsoft.com/en-us/library/hbxc2t98%28VS.85%29.aspx

VBScript – http://msdn.microsoft.com/en-us/library/t0aew7h6%28VS.85%29.aspx

Please free to comment or  share how you have started your exploration…

Thanks & Regards,
Giri Prasad
Believe!!! There are 101 ways to automate…

Identifying objects using MSAA


Hi,

Recently I benefited from MSAA support in TestComplete and like to share with you the same.

The problem came up when I intended to automate few of the UI (windows application) controls. I tried this in a system where I have TestComplete 7.5 installed on Windows XP.

To be clearer on the issue, TestComplete shows the entire application as a single window (inside its object browser tree) without any child windows/controls. When I try to record the actions on the controls like text box and radio button, all were recorded as actions with respect to window co-ordinates and not with actual controls. Surely script will be having issues when relied on these co-ordinate related actions.

I am clear that TestComplete is not recognized or the application’s controls were not open enough to automate them.

This intuited to try MSAA mechanism and as expected, succeeded in automating all the controls on the above mentioned application with the help of exact object identification.

My questions on this issue:

  1. What is MSAA?
  2. How the TestComplete able to identify individual controls after configuring MSAA?
  3. Why this feature is not available by default?

What is MSAA?

According to Wikipedia “Microsoft Active Accessibility (MSAA) is an API for user interface accessibility, designed to help Assistive Technology (AT) products interact with standard and custom user interface (UI) elements of an application (or the operating system), as well as to access, identify, and manipulate an application’s UI elements”.

Simply we can access UI controls and its properties when interfaced through MSAA mechanism.

TestComplete uses this technology to get access to UI control’s properties and methods which are not readily exposed. This is done with help of AUT window’s class name.  MSAA configuration can be done in the project properties as below in TestComplete,

  1. Select ‘Project properties -> Open applications -> MSAA’.
  2. In the ‘list of accepted windows’ list view, add new item and specify the windows class name whose child controls are not recognized.
  3. Save the changes.

How the TestComplete able to identify individual controls after configuring MSAA?

Basically when above configuration is done, TestComplete will query for the UI control details using MSAA mechanism and populate them in the object browser.

And remember, TestComplete will able to identify the controls only if the object/window of AUT implements the IAccessible interface.

Why this feature is not available by default?

Just to avoid complexity, this feature is not available by default. If it is enabled then TestComplete object browser will be loaded with lot of windows and controls which we may not be using always which in turn affects system/execution performance. I guess this will be the reason behind limiting the MSAA configuration to projects and not even project suites.

To summarize, if you face any problem where any of the AUT UI controls were not recognized in TestComplete try to check the below items:

  1. AUT is a windows application and TestComplete identifies only main window which has child windows/controls.
  2. In the object tree, the last identified window has a wndclass property.
  3. The Application/Window object implemented IAccessible interface.

Then MSAA should help you in automating these controls…

MSAA updates

MSAA has a new partner called UIA (Microsoft User Interface Automation) which is more advanced in querying the properties and methods.

According to Wikipedia, UIA is similar to MSAA in that it provides a means for exposing and collecting information about user interface elements and controls to support user interface accessibility and software test automation. However, UIA is a newer technology that provides a much richer object model than MSAA, and is compatible with both Win32 and the .NET Framework. UIA is designed so that it can be supported across platforms other than Microsoft Windows. For controls and frameworks written from scratch, UIA is recommended today. While MSAA is handy for relatively simple controls, the technology doesn’t support the complexity of modern user interfaces.

For more details on working with TestComplete and MSAA follow the link — http://smartbear.com/support/viewarticle/11501/

References: Wikipedia.org

Thanks & Regards,
Giri Prasad
Believe!!! There are 101 ways to automate…