Length of Array is returned as undefined
Hi,
For the code below, the length of Array is returned undefined, even though the Array is not empty. I have tried using both "length" and "Count" to get the length of Array but it is returning undefined for both. Please help me figure out what I am missing, I don't see anything wrong with the code.
function Test1()
{
var AppProcess = Sys["WaitProcess"]("AXISEL");
var ArrProps = new Array("Description","ObjectType");
var ArrVals = new Array("*Batch Name: GlaaS Post Job Submission*","ListItem");
var ListJob = AppProcess["FindAllChildren"](ArrProps,ArrVals,1000);
var ArrLength1 = ListJob.length;
var ArrLength = ListJob.Count;
ListJob[ArrLength - 1].Click();
Delay(1000);
}
I haven't tested the code, but could you replace the code with this, to see if it logs the length of ListJob.
var ListJob = AppProcess["FindAllChildren"](ArrProps,ArrVals,1000); // Replace the above with this var ListJob = AppProcess["FindAllChildren"](ArrProps, ArrVals, 1000)["toArray"](); Log["Message"]("Total number of ListJob: " + ListJob["length"]);