Запускаю скрипты testexecute через COM
Как передавать значение переменной?
Например, в функцию
function b(a) { Log.Message(a); }
Ну и сам код (извините за vbs :)
Sub MySub ' Initialize variables sProjectNameFileName = "\\xxx\d\autotests\Autotests.pjs" sProjectName = "Autotests" Set cmdLine = Wscript.Arguments sUnitName = cmdLine(0) sRoutineName = cmdLine(1) ' Checks if TestExecute is open Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") Set colItems = objWMIService.ExecQuery("Select * from Win32_Process WHERE Name = 'TestExecute.exe'") ' Creates TestExecute object if colItems.Count = 0 then Set WshShell = WScript.CreateObject("Wscript.Shell") WshShell.Run Chr(34) & "C:\Program Files (x86)\SmartBear\TestExecute 11\Bin\TestExecute.exe" & Chr(34), 1, False WScript.sleep(5000) end if ' Connects TestExecute object Set TestCompleteApp = GetObject(,"TestExecute.TestExecuteApplication.11") ' Opens the project If Not TestCompleteApp.Integration.IsProjectSuiteOpened Then TestCompleteApp.Integration.OpenProjectSuite sProjectNameFileName end if ' Runs the routine //Вот здесь нужно как-то передавать значение переменной TestCompleteApp.Integration.RunRoutine sProjectName, sUnitName, sRoutineName Set TestCompleteApp = nothing End Sub MySub