0 Shares 1232 Views 8 Comments

Resolving Object Identification Issues Runtime

Nov 28, 2013
1232 Views 8

Name MappingWhen we execute a large number of test cases, say 50-100  in Batch Execution using TestComplete, sometimes TestComplete does not recognize the objects. But if the same object is highlighted manually, it gets highlighted.

Its weired, isn’t it? But Yes, it do happen in reality. This is due to the reason that, the object mapping stored in TestComplete for objects is not able to match it with the object state at the run time.

To overcome this issue,TestComplete provides us different methods which can be used to refresh the object state.

  • Refresh method
  • RefreshMappingInfo Method

Refresh method

By using this method, the tree hierarchy of the application under test gets updated(refreshed) along with all the windows and child objects present in the application.

Syntax:

Where

TestedObj : Reference to the object that is present in Application under test.

Result: None

RefreshMappingInfo Method

When we map the object of Application under test for first time using NameMapping or Aliases, TestComplete searches for the object in the object tree and stores a reference to this object. At the run time TestComplete uses the stored reference to forward the method calls to the mapped object. If the object is recreated, the reference becomes invalid. In such case RefreshMapping method is used to update the reference to the underlying object.

Syntax:

Where

TestedObj : Reference to the object that is present in Application under test.

Result: None

To understand it better, lets take a scenario where a notepad is mapped using its caption name(Untitled.txt). When we open a file in the notepad, its caption changed to the file name. for example “Automate-360.txt”. Now when you will try to write some text into the file at runtime, it wont allow you do say as it does not identify the object which got changed at runtime when you opened another file into the notepad. In order to use the same mapped object to write something in this new file we can use the RefreshMappingInfo method.The code for the same could be as below:

Incorporating these methods in your automation scripts will help you in smooth batch execution of the testcases in TestComplete.

Happy Learning!!!!!

let us know your feedback, questions, suggestion via the comments below.

You may be interested

Setting up Web Service Automation Project
Katalon Studio
481 views
Katalon Studio
481 views

Setting up Web Service Automation Project

Saket - Oct 24, 2017

Web services are specific services that can be published and called over the Internet by client applications. Katalon Studio supports functional testing of web services. This topic…

Setting up Mobile Automation Project in MacOS
Katalon Studio
537 views1
Katalon Studio
537 views1

Setting up Mobile Automation Project in MacOS

Saket - Oct 09, 2017

Using Katalon Studio, mobile tester can design automation test for both Android and iOS to run on physical devices, cloud services and emulators. This tutorial explains how…

UFT Jenkins Integration
Unified Functional Testing
1642 views
Unified Functional Testing
1642 views

UFT Jenkins Integration

Saket - Oct 03, 2017

In our earlier post, we got to know the easy integration of UFT with GIT. This post focuses on integration of UFT and Jenkins. I have also…

8 Comments

  1. Hi Anurag,

    I am having tough time in recognizing the child objects of an expandable tree structure. When I use object spy for a child object(after expansion) it’s taking the parent object properties for the whole structure.That means it’s treating whole structure as a single entity(only parent properties are identified).When recording the script it’s taking co-ordinates value to recognize the child objects.Please help me with that. The structure you can visualise as in QC.

    Reply
    • Hi All,

      any one have solutions for this issue. please post ..

      issue:
      Tech:Java .
      Desktop application ,
      Domain: Banking
      when we click on desktop application’s button (eg: transaction history). application open new window in web, the web window is have dynamic values developed in javascript..web window’s child objects are not identifiable by object spy.. need to verify those dynamic values

      Thanks

      Reply
  2. Hi Manish,

    I am not able to get the exact issue you are facing.But i think you are not able to create aliases for child objects.Please follow the below step to create aliases for child object.

    1)Go to tools—>options
    2)Click on general tab
    3)Check “Create aliases for child objects”
    4)Click on OK button.

    Let me know if this helps you..

    Reply
    • any one have solutions for this issue. please post ..

      issue:
      Tech:Java .
      Desktop application ,
      Domain: Banking
      when we click on desktop application’s button (eg: transaction history). application open new window in web, the web window is have dynamic values developed in javascript..web window’s child objects are not identifiable by object spy.. need to verify those dynamic values

      Thanks

      Reply
  3. Hi Anurag,

    I am also facing same issue as Manish is facing. Child objects are not recognized by testComplete. Only parents objects are recogniszed. When recording the script it’s taking co-ordinates value to recognize the child objects. Checkbox “Create aliases for child objects” is already checked. Still not able to recognize the objects.
    I am using Java script .Is there any way to recognize the child object using Java script.
    Can you pl help.

    Reply

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...