While Loop in Keyword Test/Script
I'm trying to implement a while loop in one of my tests that will hopefully execute the commands within the loop until the condition it's testing for is no longer met.
However, it doesn't seem to want to work. Here's what I have (below), converted to a script (from a keyword test).
It doesn't matter if the ActiveAlarmsList has any items in it - whether it's visible on screen or not when an entry is added to it; the test just runs as normal, as if there were no WHILE clause present.
However, if there's an entry in the list when this function is called/run, then it will exit straight away.
How can I do some kind of monitoring of this list, and if there is > 0 or !=0 items in it at some point, quit out of the current test/function?
There must be a way, surely ?
Thanks,
Jono.
function Test3()
Test3()
{
while(Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["AlarmsTabs"]["AlarmsTabControl"]["Alarms_ActiveAlarmsTab"]["ActiveAlarmsPage"]["ActiveAlarmsSplitContainer"]["AlarmsListSplitterPanel"]["ActiveAlarmsList"]["wItemCount"] == 0)
{
//Clicks the 'JobsButton_Button' button.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["NavigationToolbar"]["JobsButton"]["JobsButton_Button"]["ClickButton"]();
//Selects the 'Job Editor' tab of the 'JobsTabControl' tab control.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["JobsTabs"]["JobsTabControl"]["ClickTab"]("Job Editor");
//Clicks the 'wButtonsRight(0)' editor button.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["JobsTabs"]["JobsTabControl"]["Jobs_JobEditorTab"]["QuickJobEditorPage"]["JobEditor_LoadPortComboBox"]["JobEditor_LPText"]["wButtonsRight"](0)["Click"]();
//Clicks at point (60, 19) of the 'WinFormsObject("ValueListDropDownUnsafe", "")' object.
Aliases["Nano_UI"]["WinFormsObject"]("DropDownForm", "")["WinFormsObject"]("ValueListDropDownUnsafe", "")["Click"](60, 19);
//Clicks the 'JobEditor_LoadButton' button.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["CommandToolbar"]["CMDButton1"]["JobEditor_LoadButton"]["ClickButton"]();
//Delays the script execution until the specified property equals the specified value or until the specified time limit elapses.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["JobsTabs"]["JobsTabControl"]["Jobs_JobEditorTab"]["QuickJobEditorPage"]["JobEditor_RecipeTabControl"]["WaitProperty"]("Enabled", true, 5000);
//Selects the 'Cluster Recipes' tab of the 'JobEditor_RecipeTabControl' tab control.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["JobsTabs"]["JobsTabControl"]["Jobs_JobEditorTab"]["QuickJobEditorPage"]["JobEditor_RecipeTabControl"]["ClickTab"]("Cluster Recipes");
//Clicks at point (94, 11) of the 'HappyPath1.xml' item of the 'JobEditor_ClusterRecipesTab_Treeview' tree.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["JobsTabs"]["JobsTabControl"]["Jobs_JobEditorTab"]["QuickJobEditorPage"]["JobEditor_RecipeTabControl"]["JobEditor_ClusterRecipeTabPage"]["JobEditor_FilteredClusterRecipeTreeView"]["JobEditor_ClusterRecipesTabControl"]["JobEditor_AllRecipesTab"]["AllRecipesTreeView"]["JobEditor_ClusterRecipesTab_Treeview"]["ClickItemXY"]("HappyPath1.xml", 94, 11);
//Drags from point (90, 267) of the 'JobEditor_SlotMapUltraGrid' object to offset (4, 40).
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["JobsTabs"]["JobsTabControl"]["Jobs_JobEditorTab"]["QuickJobEditorPage"]["JobEditor_SlotMapUltraGrid"]["Drag"](90, 267, 4, 40);
//Clicks the 'JobEditor_ToggleRecipeButton' button.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["JobsTabs"]["JobsTabControl"]["Jobs_JobEditorTab"]["QuickJobEditorPage"]["JobEditor_GridButtonPanel"]["JobEditor_ToggleRecipeButton"]["ClickButton"]();
//Clicks the 'JobEditor_QueueJobButton' button.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["CommandToolbar"]["CMDButton2"]["JobEditor_QueueJobButton"]["ClickButton"]();
//Clicks the 'Button' button.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["NavigationToolbar"]["SystemButton"]["Button"]["ClickButton"]();
//Selects the 'Process Jobs' tab of the 'SystemTabsControl' tab control.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["SystemTabs"]["SystemTabsControl"]["ClickTab"]("Process Jobs");
//Checks whether the 'wItemCount' property of the Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["SystemTabs"]["SystemTabsControl"]["System_PJsTab"]["ProcessJobsPage"]["SYS_processJobsSplitContainer"]["SYS_PJsSplitterPanel1"]["ProcessJobListView"] object equals 1.
aqObject["CheckProperty"](Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["SystemTabs"]["SystemTabsControl"]["System_PJsTab"]["ProcessJobsPage"]["SYS_processJobsSplitContainer"]["SYS_PJsSplitterPanel1"]["ProcessJobListView"], "wItemCount", 0, 1);
//Delays the script execution until the specified property equals the specified value or until the specified time limit elapses.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["ModulePanel"]["SystemTabs"]["SystemTabsControl"]["System_PJsTab"]["ProcessJobsPage"]["SYS_processJobsSplitContainer"]["SYS_PJsSplitterPanel1"]["ProcessJobListView"]["WaitProperty"]("wItemCount", 0, 600000);
//Clicks the 'JobsButton_Button' button.
Aliases["Nano_UI"]["NanoFrame"]["MainPanel"]["NavigationToolbar"]["JobsButton"]["JobsButton_Button"]["ClickButton"]();
}
}