Jump to content

Recommended Posts

Posted

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 ?

 

Posted

I know this option.

On many occasions WinExists returns TRUE,

While the GUI is not loaded yet.

I need to verify (after WinExists) that the GUI is loaded in order to proceed testing...

Posted (edited)

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.
Posted

Sure,

I'm using too loops for a  certain amount of time.

If the time expires and there is no "Exists,Visible,Enabled...."

I fail the test.

Posted (edited)

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
Posted

Use ControlCommand to check if a control is exist or not

 

Using ControlCommand to check if a control is exist or not is working excellent...

Thanks Michael

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...