Ask a Question

How to solve "Prepare object recognition hint" cost a lot of time on used object

danalu
Contributor

How to solve "Prepare object recognition hint" cost a lot of time on used object

Greeting!

 

i am testing on Java application. after upgrade to TC 12.42, i found it keep stuck at "Prepare object recognition hint" , which cost a lot of time to go throught. scenario is perform a butto click on a dialog and it closed after done. but code keeping waiting saying "Prepare object recognition hint"

Below is my simple sample:

 

def Test1():

java = Aliases.java
summaryGrid = java.Workspace.RootPane.null_layeredPane.null_contentPane.ContentContainer.MainContainer.Panel.MainDockingContainer.DefaultDockingManager_DockedHiddenSlidingContainer.DockedHiddenContainer.ContainerContainer.DockedFrameContainer.Panel.ContainerContainer.FrameContainer.View_AutoTest_Summary.RootPane.null_layeredPane.null_contentPane.HTPanel.Panel.Panel.GridPane.Viewport.Summary
summaryGrid.Click(461, 23)
summaryGrid.Keys("[F9]")
button = java.JideDialogProvider_6.RootPane.null_layeredPane.null_contentPane.StandardDialog_DefaultStandardDialogPane.NewBuySellPanel.Panel.OrderDialog_3.Panel.Panel.CustomColorButton
button.click()

 

after button click, TC not stop but keep waiting....

 

NameMapping: as screenshot

 

 

9 REPLIES 9
shankar_r
Community Hero

Java Swing applications usually have similar objects so you have to be very clear on the root path to get the child node. If there are any similar object you will get this message.

 

So, there are some techniques which you can try.

  1. Check existence of an Object before you try Click or getting information.
  2. You have to be unique enough to find the Parent object.
  3. If you still see the message which you do not want to see in your logs, you can use Log.LockEvents to turn off the warning .

Some references:

https://community.smartbear.com/t5/TestComplete-Desktop-Testing/Object-recognition-broken-in-TC12-by...

https://community.smartbear.com/t5/TestComplete-Desktop-Testing/How-to-resolve-recognition-hint-for-...

https://community.smartbear.com/t5/TestComplete-Desktop-Testing/Object-recognition-hint-fired-in-wro...

 

 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

 Thanks for quick respond, Shankar!

i've read the solution what you mentioned below.

1) add "check existence", does not work

like: 

while button.Exists:

     button.Click()

2) i recorded the action and pick up the only one tree for this object, as my screeshot, not work

3) acutally there is no warning in the log at all, it takes long time waiting, then case done successfully.

 

Best regards,

 

I had the slowness with our AUT(Java Swing application) as well.

I fixed using Java Clear Cache on each run, ExtendedFind and etc.

 

Try cleaning java cache still, if you see preformance hit then you can create support for your issue here,

https://support.smartbear.com/message/?prod=TestComplete

 


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

many thanks, 

 

how to clear Java cache in each run? can you give a code sample?

 

 

Here you go,

function JavaWSClearCache()
{
      try
      {
            Sys.OleObject("WScript.Shell").Exec("cmd /c javaws -clearcache");
            Log.Message("Java Cache cleared");
      }
      catch(ex)
      {
            Log.Error(ex.stack);
      } 
}

Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

Thank you!

 

Did you mean call clear cache before test case? seem i have no luck with it. Still same waiting message.

Another possible reason could be, if you are checking the object existence before that rendered then it will start to prepare an object recognition hint


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

Hello,

 

from the code above, i just replay the script i recorded, not checking its existence. 

Do check existence before doing any actions.


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

cancel
Showing results for 
Search instead for 
Did you mean: