Chaym Posted January 27, 2014 Posted January 27, 2014 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 ?
l3ill Posted January 27, 2014 Posted January 27, 2014 (edited) If WinExists(yournet window) Then... Edited January 27, 2014 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Chaym Posted January 27, 2014 Author Posted January 27, 2014 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...
michaelslamet Posted January 27, 2014 Posted January 27, 2014 Use ControlCommand to check if a control is exist or not
jdelaney Posted January 27, 2014 Posted January 27, 2014 (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 January 27, 2014 by jdelaney FlashpointBlack 1 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.
Chaym Posted January 27, 2014 Author Posted January 27, 2014 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.
l3ill Posted January 27, 2014 Posted January 27, 2014 (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 January 27, 2014 by l3ill My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
Chaym Posted January 28, 2014 Author Posted January 28, 2014 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
michaelslamet Posted January 29, 2014 Posted January 29, 2014 Using ControlCommand to check if a control is exist or not is working excellent... Thanks Michael Great
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now