Tried that change but testcomplete was unable to parse that line of code... checked the link provided and tried changing to this instead
function GetService(computerName, serviceName)
{
var wmiService, objectsList, eObjectsList, item, sysID;
var locator = Sys.OleObject("WbemScripting.SWbemLocator");
var objSWbemServices = locator.ConnectServer(computerName, "\\root\\cimv2");
objectsList = wmiService.InstancesOf("Win32_Service");
if (objectsList.Count > 0) {
eObjectsList = new Enumerator(objectsList);
for (; !eObjectsList.atEnd(); eObjectsList.moveNext()) {
item = eObjectsList.item();
if (item.Name == serviceName)
return item;
}
}
return null;
}
really feels like I'm going down the rabbit hole, error on run is now:
---------------------------
TestComplete
---------------------------
JavaScript runtime error.
TypeError
Cannot read property 'InstancesOf' of undefined
Error location:
Unit: "storecallvariables\ValidateErrors\Script\Unit2"
Line: 36 Column: 27.
---------------------------
OK
---------------------------