cancel
Showing results for 
Search instead for 
Did you mean: 

Same object has different identities, so "the target object does not exist" error occurs.

SOLVED
Highlighted
Contributor

Same object has different identities, so "the target object does not exist" error occurs.

Hi,

I use property checkpoint on an alert. I get the target object does not exist error.

Because the parent object was not found. When I check parent object's identities, with object Spy, I realize that some of the identities are different for example in name area old value was "WPFObject("xxxWindowxx","DesktopAlert")", new value is "WPFObject("xxxWindowxx","")".

But when I create new project (with different namemaping) I see the alert window has the value WPFObject("xxxWindowxx","DesktopAlert")". 

And I turn my main project and check the window property it seems WPFObject("xxxWindowxx","DesktopAlert")". When I run the test it fails and I check property it is again "WPFObject("xxxWindowxx","")".

I'm so confused. I have to fix it because I use this checkpoint in all tests.

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Contributor

Re: Same object has different identities, so "the target object does not exist" error occu

I guess I have found a way. I have changed the location of the object in name mapping and aliases section. I transport the object from problematic parent to reliable parent. When I run the test, it passes.

But I still don't understand why alert window's identities changed project to project.

 

View solution in original post

9 REPLIES 9
Highlighted
New Contributor

Re: Same object has different identities, so "the target object does not exist" error occu

HI @handanu ,

 To over come the mentioned issue , one possible way is, change the "DesktopAlert" to wildcard value , ie, WPFObject("xxxWindowxx","*"). This might solve the issue for time being, but i dont know exactly why the values change by time.

 

Highlighted
Contributor

Re: Same object has different identities, so "the target object does not exist" error occu

Hi,

Thank you or your reply.

But this time I get "Ambigious recognition of the tested object" warning. It takes time to find the alert. 

I keep the alert window manually to see the warning.The alert window is invisible after a while (program's behaviour). So if I do not keep the alert manually, the alert will disappear and I will get an error again.

 

Highlighted
Contributor

Re: Same object has different identities, so "the target object does not exist" error occu

I guess I have found a way. I have changed the location of the object in name mapping and aliases section. I transport the object from problematic parent to reliable parent. When I run the test, it passes.

But I still don't understand why alert window's identities changed project to project.

 

View solution in original post

Highlighted
Staff

Re: Same object has different identities, so "the target object does not exist" error occu

Nice job finding a stable parent object using the extended find! Sometimes machines are quirky and this is the best solution if we can't find a unique static path all the way down to the child object!

Best,
Justin Kim
Highlighted
Community Leader

Re: Same object has different identities, so "the target object does not exist" error occu

Hello, Handanu

 

You can also dynamically search for these objects using the .find() method.

 

https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/find-m...

 

This is much easier than moving the NameMapping repository.

Highlighted
Contributor

Re: Same object has different identities, so "the target object does not exist" error occu

Thank you Wamboo,

But I don't use script, I create keyword tests. Do you have any suggestions that I will apply with keyword testing?

Highlighted
Community Leader

Re: Same object has different identities, so "the target object does not exist" error occu

All right,

 

I've never used the keyword method before, but...

 

Is there any field to use a regular expression?

Highlighted
Contributor

Re: Same object has different identities, so "the target object does not exist" error occu

There is operation field and contains find method. 

But I have to update like hundered steps. Because I use this alert as a checkpoint item and use it everywhere.

But in name mapping I only drag and drop the alert from problematic parent to reliable parent. Just once. 

As if this were easier way.

Highlighted
Community Leader

Re: Same object has different identities, so "the target object does not exist" error occu

Ok now i understand Your solution.

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Compare images using the Region Checkpoint

See replies!

Converting UTC TimeDate in an Excel file

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors