How to handle dynamic objects in QTP?

Showing Answers 1 - 26 of 26 Answers

  • Aug 4th, 2005

To handle dynamic objects, with the windows scripting using the DOM Funda, first of all capture the desktop, then the browser and then all the inner objects in it. 

  Was this answer useful?  Yes


  • Aug 17th, 2005

by changinf the property that Quick test uses to identify that object. 
for example:object repository learnt an image propert , 
object name or image is dynamic, 
in such case you can use a property which identifies the location of object on your AUT.

  Was this answer useful?  Yes


  • Aug 25th, 2005

i think thats not the answer.Using regular expressions u can solve this problem.

  Was this answer useful?  Yes

Saraswathy & Mercy

  • Aug 27th, 2005

QTP has a unique feature called Smart Object Identification/recognition. QTP generally identifies an object by matching its test object and run time object properties. QTP may fail to recognise the dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Identification, wherein it can identify the objects even if their properties changes during run time. 
Check this out- 
If QuickTest is unable to find any object that matches the recorded object description, or if it finds more than one object that fits the description, then QuickTest ignores the recorded description, and uses the Smart Identification mechanism to try to identify the object.  
While the Smart Identification mechanism is more complex, it is more flexible, and thus, if configured logically, a Smart Identification definition can probably help QuickTest identify an object, if it is present, even when the recorded description fails.  
The Smart Identification mechanism uses two types of properties:  
Base filter properties—The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For example, if a Web link's tag was changed from to any other value, you could no longer call it the same object. 
Optional filter properties—Other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable. 


  • Aug 30th, 2005

Dynamic object is an object which changes its properties at the run time and thus its mandatory properties cant be predicted from the starting. 
To automate these objects, properties objects should be used. Here a property object is created using the description class. 
Set Obj1 = Description.Create() 
n then you can assign the name and title values to this custom object and these values can be captured during the runtime and hence using these values this custom object will identify the dynamic object in your application.

  Was this answer useful?  Yes

Suresh Chatakondu

  • Aug 31st, 2005

Regular Expression solves the problem of dynamic values in QTP. 


  • Oct 7th, 2005

Using GETRO Property we will handle the runtime objects.


  • Jan 20th, 2006

Regular Expressions solve this at the most

  Was this answer useful?  Yes


  • Sep 15th, 2006

yes,By using regular expressions we can handle the dynamic objects

  Was this answer useful?  Yes

Mahesh Gupta

  • Sep 25th, 2006

I have to ask how can I test " The images which changes dynamically" in the web page eg . - yahoo / rediffmail page 

Shrinivas G

  • Oct 6th, 2006

I got to go through lot of website and QTP help regarding handling the regularised expressions.In my App, the dialog box caption (Fax Order No. 18) is changing constantly . I have changed the properties 1. title to "Fax Order No. *"2. regexpwndtitle to "Fax Order No. *" in the object properties.But it's still not working. Can anybody help me in this regard?Thanks in advance -Shrinivas

sohaib mirza

  • Dec 29th, 2006


You suggested regular expression but I am unable to employ regular expressions as values for object properties. eg I have an object which has a property "value". I wanted to specify regular expression for value but QTP doesn't keep it. Object.Select(value) doesn't accept any regular expression.

I know regular expressions can be beneficial for checkpoints or synchronization points.

  Was this answer useful?  Yes


  • Apr 9th, 2007

As suggested you can use regular expression. You can slightly modify regular expression as follows:
"Fax Order No. . *"

I would like to answer the question "How do we test dynamic objects".
As suggested by Saurab we basically use descriptive programming to test a web page with dynamic objects. Let's take an example:

If a web page has a button which depending on certain condition it's caption changes between Yes|No. Then we write code some thing like this

if Browser(....).Page(...).WebButton("value:=Yes").Exist Then
     MsgBox "Yes button exist"

else if Browser(....).Page(....).WebButton(value:=No").Exist Then

     MsgBox "No button exist"
End if

I hope the above example answered your question.


  Was this answer useful?  Yes


  • Apr 10th, 2007

By using Regular Expressions or GetRopropery you can handle.

  Was this answer useful?  Yes


  • Jun 27th, 2007

We can handle the dynamic objects using regular expression
But, to handle dynamic link we have to use herf property

  Was this answer useful?  Yes


  • Aug 21st, 2007

Can u elaborate handling of dynamic links


Here is scenario

  1. Created user
  2. Saved
  3. Closed
  4. Search created user
  5. the searched result is displayed as a Link (emailed)
  6. The user details displayed while Clicked on EmailID  

  Was this answer useful?  Yes


  • Jan 21st, 2008

QTP genrally identifies an object by matching its test object and runtime object properties. It may fail to recognise dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Object Identification/Recognition, wherein it can identify the objects even if their properties changes during run time.

  Was this answer useful?  Yes


The question how to recognise an object which is dynamic.? Not clear how can we implement regular expression.

We can use if you know part of the string which is of name of object or name of the property then we can use reg expression?

How can we use for dyn objects...Please clarify me?


  Was this answer useful?  Yes


  • Dec 7th, 2011

use .* in place of title of the webpage enclosed in quotes. here '.'"(dot) means any character and'*"(star) means any number of characters. so for any kind of title it works.......

  Was this answer useful?  Yes


  • Jul 16th, 2014

Fax Order No.*
(no space in between . *)

  Was this answer useful?  Yes


  • Jul 21st, 2014

If object text string changing dynamically to handle the by use Regular Expression or Descriptive program is the correct method

  Was this answer useful?  Yes

renuka reddy

  • Apr 8th, 2015

By X-path also we can identify the dynamically changing objects

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account

Send   Reset


Related Answered Questions


Related Open Questions