Contributions
Re: Batch File to run a test item using TestExecute.
Thanks for the reply. If bat file is launching TestExecute, that will be an instance of TestExecute running. If only one instance of TestComplete or TestExecute can be run at one time, doesn't CreateObject function try to create and run another instance of the TestExecute or TestComplete? I received an instance of TestExecute or TestComplete is already running error message. Content of main bat file: @echo off tasklist /FI "IMAGENAME eq TestExecute.exe" | find /I "TestExecute.exe" IF ERRORLEVEL 2 GOTO Test2 echo start scripts pause @echo on :Test2 taskkill /IM TestExecute.exe /F Start /wait "TestExecute" "C:\Program Files (x86)\Automated QA\TestExecute 8\Bin\TestExecute.exe" call RunTest.bat Content of RunTest.bat file: @echo off start C:\Users\dummy_user\Desktop\TestExecuteVIACom.vbs TestExecuteVIACom.vbs Sub Test Dim TestCompleteApp, IntegrationObject, LastResult ' Creates the application object Set TestCompleteApp = CreateObject("TestComplete.TestCompleteApplication") ' Obtains the integration object Set IntegrationObject = TestCompleteApp.Integration ' Opens the project IntegrationObject.OpenProjectSuite("C:\TestComplete_Folder\Project_NameFolder\Project_Suite.pjs") ' Checks whether the project suite was opened ' If the project suite cannot be opened, closes TestComplete If Not IntegrationObject.IsProjectSuiteOpened Then MsgBox "The project suite was not opened." ' Closes TestComplete TestCompleteApp.Quit Exit Sub End If ' Needed to process errors Err.Clear 'On Error GoTo Err_Label ' Starts the project run 'IntegrationObject.RunProject "MyProject" IntegrationObject.RunProjectTestItem ("MyProject,Login") ' Waits until the test is over While IntegrationObject.IsRunning DoEvents Wend ' Checks the results Set LastResult = IntegrationObject.GetLastResultDescription Select Case LastResult.Status Case 0: MsgBox "The test run finished successfully." Case 1: MsgBox "Warning messages were posted to the test log." Case 2: MsgBox "Error messages were posted to the test log." End Select Err_Label: ' Process errors If Err.Number <> 0 Then MsgBox "Cannot start the test. Reason: " + Err.Description, vbCritical, "Error" End If ' Closes TestComplete TestCompleteApp.Quit End Sub Please suggest. Thanks, MasterMind3.4KViews0likes0CommentsBatch File to run a test item using TestExecute.
Hi, My batch file looks the following: @echo off tasklist /FI "IMAGENAME eq TestExecute.exe" | find /I "TestExecute.exe" IF ERRORLEVEL 2 GOTO Test2 echo start scripts pause @echo on :Test2 taskkill /IM TestExecute.exe /F Start /wait "TestExecute" "C:\Program Files (x86)\Automated QA\TestExecute 8\Bin\TestExecute.exe" "C:\TestComplete 8 Projects\MyTest\MyTest.pjs" /r /p:Project_Name /t:"KeywordTests|DoEnter_Info" What I am trying to do is: 1. Create a main batch file to run TestExecute. 2. Create another batch file to load projects and run specific test item. This batch file that loads projects is going to be called from the main batch file. Help will be very much appreciated :) Thanks, MasterMind26KViews0likes3Comments