Sign in to follow this  
Followers 0
Chaym

How to verify that a specific Screen (GUI) appears

10 posts in this topic

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 ?

 

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

Use ControlCommand to check if a control is exist or not

Share this post


Link to post
Share on other sites

Thanks, I'll try that...

Share this post


Link to post
Share on other sites

#6 ·  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
1 person likes this

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

#8 ·  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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Thanks Michael

 

Great :guitar:

Share this post


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
Sign in to follow this  
Followers 0