Jump to content

How to verify that a specific Screen (GUI) appears


Chaym
 Share

Recommended Posts

Hi,

When running my Auto IT test that loads an application,

I have to wait for a specific screen to appear, like a Log on Screen.

The application is written in .NET and I have no way to know

When the screen appears in order to proceed log in and then to run my test.

Is there a way to find out if the log in screen appears,

By comparing it to an image of that screen ?

 

Link to comment
Share on other sites

It's good practice to wait for multiple states before attempting to perform action on a window.

I use functions that not only check that a window exists, but also loops until a certain amount of states are found (wingetstate).

I usually wait for Exists,Visible,Enabled.

Same with grabbing controls, I loop until Exists,Enabled.

This will help scripts run consistently.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Here is an example that might help
 
This will run forever. If the regedit window exists it will popup a msgbox every second that it stays open, if you close regedit it will go back to looping and wait for it to exist again.

While 1
If Not WinExists(WinGetHandle("Registry Editor")) Then
ContinueLoop
Else
MsgBox(0, "", "Win now exists", 1)
EndIf
Sleep(50)
WEnd
Edited by l3ill
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...