how to check for different parameters
I am automating a printer application where in, No of copies and no of pages will get updated, but sometimes the application doesn't work and the no of pages and no of copies are not getting updated. I want to stop the execution when the no of copies and no of pages are not getting updated.
Right now, I have put the logic like till printing grid visiblility becomes false it has to wait for so many milliseconds. When no of pages and no of copies are not updating that grid will be visible and testcomplete runs in infinite loop. Please let me know when no of copies and no of pages have stopped updating in the application, test execution should stop and error message should be shown. Please let me know how this can be done. Please let me know as soon as possible as it is very urgent.
Please find the code below, in which I am waiting till that grid is visible, When no of copies and no of pages are totally completed, the grid becomes unvisible.
while(X.HwndSource_Window.Window.PrintQueueUserControl.btnPrintingGrid.Visible)
{
Delay(3000);
pagesprinted =X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtSheetsPrinted.get_Text;
Log.Message("Sheets printed are" + pagesprinted);
copiesprinted =X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtCopiesPrinted.get_Text;
Log.Message("Copiesprinted are" + copiesprinted);
Delay(3000);
pagesprinted =X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtSheetsPrinted.get_Text;
Log.Message("Sheets printed are" + pagesprinted);
copiesprinted =X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtCopiesPrinted.get_Text;
Log.Message("Copiesprinted are" + copiesprinted);
runtime =Aliases.X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtRunTime.get_Text;
Log.Message("Run time updated is" + runtime);
Jobstate =X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtJobState.get_Text;
Log.Message("Job state is" + Jobstate);
}