Forum Discussion
anitha123
14 years agoContributor
Hi ,
Alex, Thanks for the reply.
We are Automating Printer application. I need to capture number of copies printed and number of pages printed in my log results. In my script, I am using Wait property to wait till the Printing Job is complete and i have written code to capture number of copies and number of pages printed, scripts wait till the printing is completed, but I am not able to capture number of pages printed and number of copies printed. Please let me know how this can be achieved. Please find the below script.
for(i=0;i<Count;i++)
{
X.HwndSource_Window.Window.PrintStateUserControl.scBtnPrintJobQueue.Click();
X.HwndSource_Window.Window.PrintQueuedJobsUserControl.QueuedJob.SurfaceListBoxItem.Click();
X.HwndSource_Window.Window.PrintQueuedJobsUserControl.SurfaceButton.Click();
Delay(5000);
X.HwndSource_Window.Window.PrintStatusUserControl.SurfaceButton.Click(25,30);
Delay(1000);
X.HwndSource_ConsolePrintConfirmation.ConsolePrintConfirmation.btnPrint.Click();
Delay(1000);
X.HwndSource_Window.Window.PrintQueueUserControl.btnPrintingGrid.ClickButton();
X.HwndSource_Window.Window.PrintQueueUserControl.btnExtendedPrintingGrid.ClickButton();
copycount=X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtCopies.get_Text;
Log.Message("Copy count is" +copycount);
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);
X.HwndSource_Window.Window.PrintQueueUserControl.btnPrintingGrid.WaitProperty("Visible",false,-1);
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);
}
Alex, Thanks for the reply.
We are Automating Printer application. I need to capture number of copies printed and number of pages printed in my log results. In my script, I am using Wait property to wait till the Printing Job is complete and i have written code to capture number of copies and number of pages printed, scripts wait till the printing is completed, but I am not able to capture number of pages printed and number of copies printed. Please let me know how this can be achieved. Please find the below script.
for(i=0;i<Count;i++)
{
X.HwndSource_Window.Window.PrintStateUserControl.scBtnPrintJobQueue.Click();
X.HwndSource_Window.Window.PrintQueuedJobsUserControl.QueuedJob.SurfaceListBoxItem.Click();
X.HwndSource_Window.Window.PrintQueuedJobsUserControl.SurfaceButton.Click();
Delay(5000);
X.HwndSource_Window.Window.PrintStatusUserControl.SurfaceButton.Click(25,30);
Delay(1000);
X.HwndSource_ConsolePrintConfirmation.ConsolePrintConfirmation.btnPrint.Click();
Delay(1000);
X.HwndSource_Window.Window.PrintQueueUserControl.btnPrintingGrid.ClickButton();
X.HwndSource_Window.Window.PrintQueueUserControl.btnExtendedPrintingGrid.ClickButton();
copycount=X.HwndSource_Window.Window.PrintingJobDetailsUserControl.txtCopies.get_Text;
Log.Message("Copy count is" +copycount);
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);
X.HwndSource_Window.Window.PrintQueueUserControl.btnPrintingGrid.WaitProperty("Visible",false,-1);
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);
}