cancel
Showing results for 
Search instead for 
Did you mean: 

Timing and temporary dialogs

Highlighted
New Contributor

Timing and temporary dialogs

Hi,



I'm trying to script a test whereby a button is clicked and a progress dialog is displayed for a minimum of two seconds.

I want to check in the script that the dialog is on screen for at least two seconds.



I am having trouble getting TC to recognize fast enough that the progress dialog exists.

Seemingly, by the time it gets round to looking, the dialog has already been opened and closed.



Is there any way to speed up the script or clever (quick) method to check for existence of the dialog such that I could calculate an approximate display time?



thanks



Mike
3 REPLIES 3
Highlighted

RE: Timing and temporary dialogs

Hello Mike,




Try using the Sys.Desktop.ActiveWindow property to get the dialog with a progress bar. You can do this in a loop to get a rough estimation of the time the dialog is there.

-----

Alexander
Customer Care Manager
Highlighted
New Contributor

RE: Timing and temporary dialogs

Thanks for the reply.



I've tried using Sys.Desktop.ActiveWindow, however, I got similar results as previously.



The progress dialog I am trying to pick up should be displayed for a minimum of  2 seconds, however, if a large file is being processed it will display for longer.



In the 2 second example Sys.Desktop.ActiveWindow only seems to pick up the parent window and not the progress dialog.



In the example where it is processing for longer (and the progress dialog is displayed for longer) Sys.Desktop.ActiveWindow will pick up the progress dialog and I am able to calculate the display time.



Repeatedly logging the return value from Sys.Desktop.ActiveWindow.Name after clicking the button shows that script is being executed quick enough to pick up the progress dialog (i.e. well within 2s of clicking the button) it just doesn't seem to realise that the progress dialog is there.



Thanks



Mike





Highlighted

RE: Timing and temporary dialogs

Hello Mike,




I guess, the progress dialog opens after your test executes a click in your application.

Try replacing the Click call with the MouseDown + MouseUp calls. The point here is that the Click method's logic performs some checks to make sure that the application received the click, and this logic may take some time. At that, the MouseDown and MouseUp calls do not perform this check, so, this may help you accomplish your task. Please note that you will probably need to put a small delay between the calls.

I hope this helps.

-----

Alexander
Customer Care Manager
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors