rizal Posted August 4, 2011 Posted August 4, 2011 i need help. i'm running a software that will popup a message "Pass" for 10 seconds if the test case success. can u guys help me on how i can capture the message? the problem with my script is my test case completion time is different each time i run it. if the command start capture after the popup gone, my test case failed. can u guys suggest solutions? sleep(120000) $text = WinGetText("CCP Tester Prompt") If StringInStr($text, "Pass") > 0 Then ;MsgBox(0, "CCP Tester Prompt", $text) ;Local $resultFile = FileOpen(@ScriptDir & "\result.txt", 1);1 = Write mode (append to end of file) $resultFile = FileOpen(@ScriptDir & "\result.txt", 1);1 = Write mode (append to end of file) If $resultFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($resultFile, "") FileWriteLine($resultFile, "SW-TestCase-1 : Pass") FileClose($resultFile) Else ;Local $resultFile = FileOpen(@ScriptDir & "\result.txt", 1);1 = Write mode (append to end of file) $resultFile = FileOpen(@ScriptDir & "\result.txt", 1);1 = Write mode (append to end of file) If $resultFile = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($resultFile, "") FileWriteLine($resultFile, "SW-TestCase-1 : Failed") FileClose($resultFile) EndIf
wakillon Posted August 4, 2011 Posted August 4, 2011 (edited) you can enumerate all windows of this process ( _WinAPI_EnumProcessWindows ) and filter by text or class. Edited August 4, 2011 by wakillon AutoIt 3.3.18.0 X86 - SciTE 4.4.6.0 - WIN 11 24H2 X64 - Other Examples Scripts
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