Want to block the Error When Tree nodes are not exapandable
Hello,
I have code in Java script. I want to expand tree node using Expand command. In which i have 10 items to expand. out of 10 2 are not expandable. every time when i run the code for that 2 items Test log automatically generate the error ' The tree node cannot be expanded or collapsed.' which i dont want. I ant to stop or block that error. what can i do??
for (i = 0; i < objectChildTreeViewHelp["Items"]["Count"]; i++)
{
my_array[i] = objectChildTreeViewHelp["Items"]["Item"](i)["Text"]
stringText="|SoMachine Motion Overview|SoMachine Motion Overview|Releasenotes|"+stringReleaseNotesChildTextName+ "|" +objectChildTreeViewHelp["Items"]["Item"](i)["Text"]
objectTreeViewHelp["ExpandItem"](stringText)
Log["Checkpoint"]("Success: "+ my_array[i]+ " RealeaseNote Expanded Successfully")
}
Another way of doing this and getting to know what are all clicked, etc.
for (i = 0; i < objectChildTreeViewHelp["Items"]["Count"]; i++) { my_array[i] = objectChildTreeViewHelp["Items"]["Item"](i)["Text"] stringText="|SoMachine Motion Overview|SoMachine Motion Overview|Releasenotes|"+stringReleaseNotesChildTextName+ "|" +objectChildTreeViewHelp["Items"]["Item"](i)["Text"] var stringTextArr = stringText.split("|"); var currentItem = objectTreeViewHelp.Items("SoMachine Motion Overview"); var menuToClick = "|SoMachine Motion Overview"; for(ml = 2 ; ml < stringTextArr.length ; ml++){ var currentChildMenu = stringTextArr[ml]; menuToClick += "|" + currentChildMenu; currentItem = objectTreeViewHelp.Items(menuToClick); if (!strictEqual(currentItem.Items, null)){ objectTreeViewHelp["ExpendItem"](menuToClick); }else{ objectTreeViewHelp["ClickItem"](menuToClick); } } Log["Checkpoint"]("Success: "+ my_array[i]+ " RealeaseNote Expanded Successfully") }