Wait 15 mns if a popup appears

Getting started -basics for starting with WinTask

Wait 15 mns if a popup appears

Postby Mats on Tue Aug 26, 2014 8:49 am

When I am running a routine a dialog box from the application I'm running occasionally pops up asking if I want to continue. When this occurs I want to wait 15 mins before I click the "Yes" button to continue. I need to:

1. detect when the dialog box appears
2. wait 15 mins
3. click "Yes"
4. continue the process that was running

Is this possible with WinTask?
Posts: 15
Joined: Thu Oct 06, 2005 9:00 am

Re: Wait 15 mns if a popup appears

Postby TechSupport on Thu Aug 28, 2014 8:18 am


Yes WinTask can automatize the steps that you describe. Here is a script example on our demo web site:
Code: Select all
StartBrowser("IE", "www.wintask.com/demos", 3)

UsePage("WinTask Demonstration Pages")
                ClickHTMLElement("A[INNERTEXT= 'Form']")

                WriteHTML("INPUT TEXT[NAME= 'company']", "tt")
'A click on Popup window link makes a small window appear
                ClickHTMLElement("A[INNERTEXT= 'Popup window']")
'I wait 10 ticks (1/10 sec) to be sure that the window has time to be displaed
Pause 10 ticks
'I test if the window is there, if yes, I wait 5 secs (increase the value for 10 mns) and then clicks OK button
If ExistW("IEXPLORE.EXE|#32770|Message from webpage",topinstance())=1 then
                Pause 5 secs
                UseWindow("IEXPLORE.EXE|#32770|Message from webpage",2)
'I close IE
CloseWindow("IEXPLORE.EXE|IEFrame|Form - Internet Explorer",1)

WinTask Tech Support
Posts: 805
Joined: Thu Nov 16, 2006 9:58 am

Return to Getting started

Who is online

Users browsing this forum: No registered users and 5 guests