Contributions
Wait Window Using VBScript - You're Help example doesn't appear to work
Found an example in Help that tried to explain how the Wait Window function operates only the example in vbscript doesn't appear to work on our 10.3 version. It is under "Waiting for an Object, Process or Window Activation" when searching Help. in TestComplete. This looks like it would be helpful if I could get it to work. Sub Test i = 0 Set p = Sys.Process("Notepad") Do Set w = p.WaitWindow("*", "Open", -1, 5000) i = i + 1 Loop Until (w.Exists And w.VisibleOnScreen) Or (i > 10) If Not (w.Exists And w.VisibleOnScreen) Then Log.Warning "Window not found." Else Log.Message "Window was found." End If End Sub Also, we're seeingan unusual number oferrors that report the window doesn't exist, but the screenshot shows that the window appears in the picture. Please advise. Thanks, Richard Y.1.7KViews0likes1CommentRe: Shell executing Xcopy in TestComplete
Thank you so much! Actually, I should have added "using vbscipt", but your response gave me a V8 wakeup call and I came up with the following... Sub XCopySomeFiles() Dim svOperation 'XCOPYCommandLineStringToExecute = "XCOPY.EXE " & svSOURCEFOLDER & arrInternalMapTesterFileNames(i) & " " & svTARGETFOLDER & " /c /d /f /o /q /v /y" svOperation = "C:\TestLogs\XcopyTest.txt _ C:\TestImages\ /c /d /f /o /q /v /y" Call XCopyEXE(svOperation) End Sub Function XCopyEXE(svXCopyOperation) Dim oWScript, oExec Set oWScript = CreateObject("WScript.Shell") XCopyEXE = False Set oExec = oWScript.Exec("C:\Windows\System32\Xcopy " &svXCopyOperation) If NotaqFileSystem.Exists("C:\TestImages\XcopyTest.txt")Then Log.Error("Error - XCopying operation did not succeed for the operation: '" & svXCopyOperation & "'.") End If Set oWScript = Nothing Set oExec = Nothing End Function954Views2likes0Comments