I have a problem i have this application window "Person", which i have made as a Regular Expression to work in the test as(.* Person.*)
Now i have this second window "Trace a Person" whenever i try to do an operation on this window it automatically creates a Repository in the window "Person" and when i record on the second window it records as "Person".......(However if the first window is not present in the test and i just perform operation on Trace A Person .......it records as "Trace A Person".....
and if the first window "Person" is present in the test it recogniges and forms the repository in Person itself and refuses to recognivze this window and any operation on it uniqely.)
Thus when i run the test it cannot really recognize window "Trace A Person" because it says it cannot uniquely identify the object add some more properties .........when i try to add some properties it refuses to recognize the main window itself ie Person.
Smart Identification is also ON.
Mark, the problem is it cant read the window name as "Trace A Person" when window "Person" is open.
MAIN WINDOW: PERSON
SUB WINDOW: TRACE A PERSON
But if i do not have a repository for person it reads/ detects the window as "Trace A Person" and if i hve a repositiory for 'Persom" it automatically defaults to it and u can't even see trace a person" in its properties.
Also, what about adding a mandatory property for your windows - look for one that is similar to ischild or isownedwindow or such - meaning that you will force QTP to pick up whether the window is the parent or the child or another window - since the trace a person window is the child of the Person window it will force a different window to be learned for each as their properties don't fully match.
The problem..in case it's not terribly obvious is that you have a regular expression that is telling QTP that Trace a Person and Person are the same as your .*Person.* matches both window names..so they are not unique. Mark's suggestion should work but to make it easier down the road adding the extra property should help future issues.