Micro Focus QTP (UFT) Forums
Objects keep changing names - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Objects keep changing names (/Thread-Objects-keep-changing-names)



Objects keep changing names - janriis - 09-27-2010

Hi all

My scripts wont run, probably due to some runtime change in object names.

example

Code:
Browser("Mercury Tours").Page("Mercury Tours")

Changes to: Browser("Mercury Tours_2").Page("Mercury Tours_2")

I can do a maintenance run, but that only helps temporarily until the next change.

Anyone who can help ?


RE: Objects keep changing names - A.Saini - 09-27-2010

Hi,

If you are using object repository.Your script will run only when QTP is able to identify the object.

In following cases QTP does not identify the object:

a) When dublicate object exist.

b) Object does not exist.

c) Object property micmatch.

In your case it's dublicasy of the the objects.
Smile


RE: Objects keep changing names - janriis - 09-28-2010

Hi Ankur

Its not duplicate objects that are the problem here. It is the way QTP sees the pages runtime. If i do a maintenance run, the pages get a _2, _3...etc. So instead of seeing:

Code:
Browser("Mercury Tours").Page("Mercury Tours")
it sees :
Code:
Browser("Mercury Tours_2").Page("Mercury Tours_2")