Come let us explore together…

Posts tagged ‘Object Spy’

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…

What is new in TestComplete 8 ? – Part 1


Hi All,

Last week the much awaited TestComplete 8 (TC8) was released after successful beta testing. This was the first release from AutomatedQA after it merged itself with other similar vendors and makes a new company SmartBear software.

This version is said to be developed closer and communicative with its ally’s products (SmartBear and Pragmatic products).  Come let us try and experience whether we can benefit or not !!!

Before installing there is no much system requirements to be taken care of. If your system has TestComplete 7 and working fast enough, you can directly install version 8 and no additional resources are needed.

Also don’t directly open any projects developed in previous versions of TestComplete in TC 8. Because once it is opened, TC8 will convert to its version and you cannot open the same project with lower versions. (Take a backup of your projects before using TC8). From the perspective of AutomatedQA, what is new or enhancements?

  1. UI changes
  2. Support for latest products/applications
  3. Test Visualizer
  4. Name Mapping enhancements
  5. DDT enhancements
  6. Network suite enhancements
  7. TestLog enhancements
  8. Script Extension enhancements
  9. Other differences

This week I tried with the new TestComplete 8 (8.0.290.7) trial version and like to share my experience. You can install TestComplete 8.0 in parallel with 7.52 version. (No need to remove or upgrade previous version)

UI changes:

The first change everyone expects was with UI level changes. Most of the newer versions come with a mandatory UI change. Also we cannot accept it is a new version without these changes.

In TC8 there is not much change in the menu and tool bars other than changes in Run button and Checkpoint buttons.

You will observe more changes in the UI if your have Windows Vista or later OS versions…

  • You can see new Recording toolbar (with dense down items) having only Play, Pause and Stop buttons. The other recording items are hidden and can make it visible using the slider in the toolbar.
  • While opening the project we can see a link to sample TestComplete projects in the file open dialog box which simplifies the access to stored sample projects.
  • During playback you can see a playback toolbar near the TestComplete notification area (Upper right corner) holding buttons to Pause and Stop payback.
  • The object property icon is renamed to “Object Spy
  • Refresh and Highlight toolbar buttons are added in the NameMapping section

Support for latest products and applications:

Comparing with the older versions, TestComplete 8 supports the following:-

  1. .NET framework 4.0
  2. 64-bit Windows, .NET and Java applications
  3. Microsoft Silverlight 3
  4. Mozilla Firefox 3.6

In addition it can access methods inside JAR files and 64-bit DLLs. We can write code to call the methods defined in JAR file and 64-bit DLLs.

Test Visualizer

TestComplete 8 has new feature called Test Visualizer which is useful while recording, mapping objects, play back and result verification.

From my understanding Test Visualizer is a new feature which takes screen shots of Application Under Testing(AUT) for the on-screen actions (Click, SetText, etc,.) done. This will work only while your record through TestComplete 8 version. (For older projects you need to re-record the test steps to bring in the feature)

TestVisualizer sample screen shot
Figure showing the Test Visualizer feature

Advantages:-

  1. Track the test recording and execution. (Both sequence and actions)
  2. Without having the actual AUT running, map the objects directly from Test Visualizer.
    1. I think TC is not just taking a screen shot for the Test Visualizer. Because we have an option here in the frames to map object dynamically without the actual object running behind.
    2. To map the object which you missed while recording just click the Eye icon in the picture frame (Test Visualizer), this will open the “Visualizer Frame” where we can see the recorded AUT screen.
  3. Using this frame we can map new object directly by scrolling through and right clicking the screen object (If it is already mapped , shows as mapped)
  4. If the AUT was changed after recording you can update the changes right from this Test Visualizer using “update from screen” option available in Visualizer frame. (AUT respective screen must be active(running) for this option alone)
  5. You can add on-screen action test step from this frame when using a keyword driven test

How about resource consumption for this feature ?  Need to wait and see !

Name mapping enhancements

Name mapping is a feature where definitely lot of improvement should come. AutomatedQA is constantly placing enhancement to make it comparatively good.

Conditional mapping is a cool option added in TC 8. We can map our object based on few conditions (AND & OR). When you map an object, in the “object name mapping window” we can find an option to switch between Conditional or Basic mode. Basic mode is usual way of mapping; Conditional is having different values for same property or different property itself for an object.

In conditional mode, we can design the condition by adding property-value along with condition type to tell how TestComplete how an object should be recognized.

This way we can avoid lot of conditional statements and property validations inside the scripts and get it done in primary location. Usually this may helpful when the script is handling different version of AUT in different environments.

Also it is said that highlighting and deletion is made easy in this version.

Hope there are 101 ways to Automate…
Thanks & Regards,
Giri Prasad