Ask a Question

Slow object recognition working with swing application

rvg
Occasional Contributor

Slow object recognition working with swing application

Hi everybody,

 

I am working with the automated tests for a swing application. Tests are being developed for rather long time. Usually they are performed with a good speed. But sometimes the objects recognition becomes too long - it takes up to 10 seconds per object. And, that is even more surprising, an object is not remembered after it was recognized. Next reference to its alias in script code forces the recognition again. Another thing that is unusual is that for some windows belonging to application the recognition is fast and for some others it is slow.

 

I have not any guess why this happens. Some time ago this issue encountered after I had installed the new version of TestComplete instead of 14.74. And when I had returned back to 14.74 everything became good.

 

Now I observe this behaviour for both 14.74 and 14.92 versions which I try to use for tests. And one more strange thing is that the tests were running good for current application version for last two weeks.

 

Regards

 

7 REPLIES 7
brumazz
Staff

Re: Slow object recognition working with swing application

Hi rvg, 

 

Have you looked into editing the mapping of those objects?

It sounds like they are being found, but possibly using the 2nd selector in the name mapping.

Can you share a screenshot of your log?

MarkHays
New Contributor

Re: Slow object recognition working with swing application

I have seen something similar recently.  What I have been able to speculate is that objects that are hidden, seem to take the object timeout time before they return.  I am performing web testing.   Did seem to happen with a somewhat recent update to test Complete.

rvg
Occasional Contributor

Re: Slow object recognition working with swing application

Hi brumazz,

 

1) For identifying each object only the unique id is used that is assigned to it by swing. I think, if the problem was in name mapping, it would occur persistently.

 

2) I am attaching two fragments of the log that refer to the same run of the script. In these fragments the record 'Checking Certificates Tab' is placed to the log by a function which checks controls on specific tab of the window. This tab contains 4 objects of type JTable and 16 objects of type JButton. Function gets the state and  content of these objects and compares the data to state saved previously. During the run the window was opened twice for different tasks. During the first opening the objects recognition was slow. It took 10 seconds per object, so the total time for function call was approximately 3 minutes. For the second time the function call was shorter than 1 second.

 

Regards

 

P.S.
I wonder, is it occasional coincidence that the Auto-wait timeout in Playback section in project properties contains the value of 10000 ms?

 

 

rvg
Occasional Contributor

Re: Slow object recognition working with swing application

It was not a right thought about  Auto-wait timeout. If it was reached the script would be stopped with error message. Most likely delay is a little smaller in my case.

rvg
Occasional Contributor

Re: Slow object recognition working with swing application

Thanks,

 

Your idea is right, as it seems to me. After some experiments it became clear, that in my case the reason of the long time delay is that the objects being recognized are positioned on the window tabs that have no focus. It was possible as the code only needed to read their state, not to change. After adding to my code the swithching to a tab before accessing its controls the script was performed quickly.

Now I'd like to know - is it a bug of TestComplete or of the application under the test?

MarkHays
New Contributor

Re: Slow object recognition working with swing application

You could change the object timeout and see if there is a corresponding change in the object recognition.   I had created a small test that timed how long it took to access of an object.  My findings were that attempting to access an object that was hidden took the entire object timeout time + a small amount, but did not result in an object recognition error.   

rvg
Occasional Contributor

Re: Slow object recognition working with swing application

The archive contains the demo project and java application.

cancel
Showing results for 
Search instead for 
Did you mean: