Jump to content

Trouble waiting for window


Recommended Posts

So simple, yet I cannot get it to work

Do
Sleep (500)
; wait until either account exists error or Userlist meaning account created successfully or window to close
Until WinActive ("Message") or WinActive ("SWAT", "http://synapsedc/swat/userList.asp") or WinClose ("SWAT")
If WinActive ("Message") Then ; if account exists
   WinWaitClose ("Message"); Wait until user dismisses it
   _IEQuit ($oIE); Quit IE
   EndIf; loop continues


If WinActive ("SWAT", "http://synapsedc/swat/userList.asp") Then MsgBox (0, "test". "Yes"); if this window appears, account created successfully


If WinClose ("swat") Then Exit

The first one works fine.  It sees the "message" window and does what its supposed to do.  The other 2, which are looking for IE windows, like the one below, do not seem to work.

>>>> Window <<<<
Title: SWAT - Windows Internet Explorer provided by ***
Class: IEFrame
Position: 470, 207
Size: 800, 570
Style: 0x16CF0000
ExStyle: 0x00000100
Handle: 0x00C1085E

>>>> Control <<<<
Class: Internet Explorer_Server
Instance: 1
ClassnameNN: Internet Explorer_Server1
Name: 
Advanced (Class): [CLASS:Internet Explorer_Server; INSTANCE:1]
ID: 
Text: 
Position: 0, 139
Size: 792, 374
ControlClick Coords: 314, 64
Style: 0x56000000
ExStyle: 0x00000000
Handle: 0x00CA0BAC

>>>> Mouse <<<<
Position: 314, 203
Cursor ID: 0
Color: 0x336699

>>>> StatusBar <<<<
1: http://synapsedc/swat/reports.asp
2: 
3: 
4: 
5: 
6: 
7: 
8: 
9: 
10: 

>>>> ToolsBar <<<<

>>>> Visible Text <<<<
Navigation Bar
http://synapsedc/swat/userList.asp
Address Combo Control
Page Control
Live Search
Search Combo Control
Search Control
Command Bar
Favorites Command Bar
LinksBand
Favorites Bar
Add to Favorites Bar
ITBarHost
Menu Bar
SWAT - Windows Internet Explorer provided by ***
http://synapsedc/swat/reports.asp
Zoom Level
Your current security settings put your computer at risk. Click here to change your security settings...

>>>> Hidden Text <<<<
Live Search

Edited by wisem2540
Link to comment
Share on other sites

  • Moderators

Hi, wisem2540. Have you tried setting the WinTitleMatchMode differently, to see if that could be the issue? For IE windows I often set it to 2 so it will match any substring in the title, rather than trying to match from the beginning.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

It it helps at all,

I put just these two lines in a script

WinWaitActive ("SWAT", "http://synapsedc/swat/userList.asp")
MsgBox (0, "test", "Yes"); if this window appears, account created successfully, exit IE and continue loop

Then if I manually browse to the URL, I get the msgbox.  So I know its seeing the window.  Could there be something else?

Link to comment
Share on other sites

Here is the latest code I have tried.  If not winexist is not working either

Do
Sleep (500)
; wait until either account exists error or Userlist meaning account created successfully or window to close
Until winActive ("Message") or WinActive ("SWAT", "http://synapsedc/swat/userList.asp") or Not WinExists ("SWAT")


If WinActive ("Message") Then ; if account exists
   WinWaitClose ("Message"); Wait until user dismisses it
   _IEQuit ($oIE); Quit IE
   ContinueLoop
   EndIf; loop continues


If WinActive ("SWAT", "http://synapsedc/swat/userList.asp") Then
   _IEQuit ($oIE); if this window appears, account created successfully, exit IE
   ContinueLoop ;continue loop
   EndIf


If Not WinExists ("swat") Then Exit
Link to comment
Share on other sites

Do
Sleep (500)
; wait until either account exists error or Userlist meaning account created successfully or window to close
Until WinActive ("SWAT", "http://synapsedc/swat/userList.asp") or WinActive ("Message") or WinExists ("SWAT") = 0


If WinActive ("Message") Then ; if account exists
   WinWaitClose ("Message"); Wait until user dismisses it
   _IEQuit ($oIE); Quit IE
   ContinueLoop
   EndIf; loop continues


If WinActive ("SWAT", "http://synapsedc/swat/userList.asp") Then
   _IEQuit ($oIE); if this window appears, account created successfully, exit IE
   ContinueLoop ;continue loop
   EndIf


;If WinActive ("Untitled") Then MsgBox (0, "yes", "yes")
If Not WinExists ("swat") Then Exit

this seems to work

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...