Jump to content

WinWaitActive with window elements are not fully visible?


Recommended Posts

Synchronizing is probably one of the most complex things in automating GUI flows

" how to wait until the complete windows load"  depends on application and your definition of "complete windows load" 

  • Find an element you can sync on
  • See if the cursor is changing from hourglass to pointer
  • ....

Some functions that can help in this (but maybe a sleep 5000 is enough on the short term)

  1. https://www.autoitscript.com/autoit3/docs/functions/ControlGetText.htm
  2. https://www.autoitscript.com/autoit3/docs/functions/ControlGetHandle.htm
  3. https://www.autoitscript.com/autoit3/docs/functions/PixelChecksum.htm
  4. UIA functions
  5. WebDriver functions if its HTML
  6. sleep nnn milliseconds
  7. https://www.autoitscript.com/autoit3/docs/functions/ControlFocus.htm on an element thats last coming up

 

Link to post
Share on other sites

you can use Control Command to Check if Button or Edit etc . if is Visible:

example:

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 438, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 88, 136, 81, 33)
$Button2 = GUICtrlCreateButton("Button2", 224, 104, 65, 41);button2
GUICtrlSetState(-1, $GUI_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
     Local $state = ControlCommand($Form1, "", "Button2", "IsVisible", "");check if Button2 is Visible
     if  $state = 1 Then
        ;
        MsgBox(0,"","Loaded")

        EndIf
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $Button1
            GUICtrlSetState($Button2, $GUI_SHOW)
    EndSwitch
WEnd

 

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...