cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to turn off object recognition hint in TestComplete12?

SOLVED
Contributor

Is there a way to turn off object recognition hint in TestComplete12?

Hello,

 

We just updated to TestComplete12 and after our lab run we noticed we had about a dozen of our tests start spitting out warnings for "Object Recognition Hints". These tests were not failing before the update, and in fact move past the hint and complete successfully. 

 

I tried clicking 'Update' but it just said that the property was not found in Name Mapping and then gives me an 'Invalid variant type' error. Is there a way to simply turn this feature off or possibly ignore the warning as you can with ambiguous warnings?

 

Thanks in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
New Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

Hello,

 

We haven't found an option to turn off this new feature.

If this helps, we are blocking the warning via the Events/GeneralEvents/OnLogWarning:

 

Sub GeneralEvents_OnLogWarning(Sender, LogParams)

' Block the warning "An object recognition hint" from TC12

If LogParams.MessageText = "An object recognition hint. See Additional Information for details." Then

LogParams.Locked = True

End If

End Sub

 

Regards

 

View solution in original post

18 REPLIES 18
Occasional Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

Hello,

 

we have the same problem with our test suite. We are using VBScript as language in Testcomplete and are testing a WinForms application.

 

There are many parts in our test functions where it might be possible that a message box opens, depending on the input to the tested application (error messages etc.). In Testcomplete 12 I always get that object recognition hint, and it is clear the object can not be recognised, because it does not exist.

 

Is there a way to avoid this warning? Maybe there is a better way to check if a window appeared or not?

 

Best regards

Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

Thanks for responding Orvai, I'm glad we are not the only ones having this problem. 

 

The strange thing about my problem is that neither the Mapping Value or the Found Value in the recognition hint are the value that we are trying to access at that particular step, so I cannot even alter the mapped value to make it happy.

 

This post hasn't gotten any answers so I am going to start a support case today. 

Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

I have the same issue

 

When using the following script:

 

if Aliases.Device.pnlBack.WaitProperty("Exists", True, 1000) = true then
   call Aliases.Device.pnlBack.Touch
   delay(2000)
end if

 

I get warnings in the log when the pnlBack doesn't exist. This wasn't an issue in TC11. This shouldn't create warnings, and is making my testreports look worse than they are.

 

Any hints to how to avoid the object recognition hints warnings in the log?

 

/Lars

Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

Hi Lars,

 

I created a support ticket but unfortunately have not yet received a solution to my problem. I am still working with a support rep, but it is my belief that this may be a defect.

 

Thanks,

Lauren

New Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

 

 

New Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

Hello,

 

We haven't found an option to turn off this new feature.

If this helps, we are blocking the warning via the Events/GeneralEvents/OnLogWarning:

 

Sub GeneralEvents_OnLogWarning(Sender, LogParams)

' Block the warning "An object recognition hint" from TC12

If LogParams.MessageText = "An object recognition hint. See Additional Information for details." Then

LogParams.Locked = True

End If

End Sub

 

Regards

 

View solution in original post

Community Hero

Re: Is there a way to turn off object recognition hint in TestComplete12?

If this is the code you are using, or something similar... 

if Aliases.Device.pnlBack.WaitProperty("Exists", True, 1000) = true then
   call Aliases.Device.pnlBack.Touch
   delay(2000)
end if

Then the problem is actually pretty simple to solve. You cannot call the "WaitProperty" method on an object that does not exist. If there is no object, you can't call a method on the object. 

What you need to do is use WaitAliasChild. Change your code to

 

if (Aliases.Device.WaitAliasChild("pnlBack", 10000).Exists) then
   call Aliases.Device.pnlBack.Touch
   delay(2000)
end if

That SHOULD correct your object recognition problem.

WaitProperty should only be used if you know the object exists and for detecting changes in a property value, not changes in the existance of an object.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Contributor

Re: Is there a way to turn off object recognition hint in TestComplete12?

Brilliant. I didn't think to use an event handler. Thanks so much wcach!

Community Hero

Re: Is there a way to turn off object recognition hint in TestComplete12?

Robert's reply (https://community.smartbear.com/t5/Desktop-Testing/Is-there-a-way-to-turn-off-object-recognition-hin...) is the correct explanation of the reason of the problem and how it should be avoided.

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
New Here?
Join us and watch the welcome video:
Watch the new Interview