Forum Discussion

anitha123's avatar
anitha123
Contributor
14 years ago

How to delay for different parameters in Testcomplete

Hi,



I am automating Printer application, where in we give different Jobs to print of different values, like No of pages to print and copies to be printed. While performing printing for different values, script needs to wait for few minutes. Please let me know how to delay the script based on different values we give.



Eg: for 1st Iteration, I will give 10 copies, no of pages 30 the script has to wait till the printing is completed.

For 2nd Iteration, I will give 20 copies, no of pages 25, the script has to wait till the printing is completed.

3 Replies

  • 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);

       

      }       
  • Hi Anitha,



    I am not able to capture number of pages printed and number of copies printed


    What exactly do you mean by that? Do you have error or warning messages in your execution logs? If you do, send me some images that will demonstrate them. Or, do you need assistance with finding a way to get the needed numbers in the script?