This question was asked in Philips. Suppose there is a printer and an software application , if u press print in application the printer starts printing. But while executing in QTP this suddenly the printer fails and QTP execution stops. iN order not to stop execution or to run the script what will be your approach ?

Questions by minni_rec   answers by minni_rec

Showing Answers 1 - 28 of 28 Answers

Jitendra Mishra

  • Aug 13th, 2007
 

Hi All,
If i am not wrong you can skip that portion where you getting the exception.

  Was this answer useful?  Yes

CPS

  • Nov 20th, 2007
 

You have to define Recovery Scenrio in this scenario.

  Was this answer useful?  Yes

Joe

  • Feb 20th, 2008
 

Hi,

This is a bit tricky question, once the quick test click "Print" button it is the system and printer communicates to get the print done. This has nothing to do with QTP and hence QTP will not stop in such case.

-Joe

ManjuPillae

  • Mar 26th, 2008
 

We can overcome by the help of Recovery Scenario.

If the printer is not connected the a dialog box appears as 'Printer Error' we can record 'Cancel' button and proceed to next step in script of QTP using recovery Scenario.

  Was this answer useful?  Yes

Satyesha

  • Jul 5th, 2011
 

Yes, goksn is correct.
If you know on which particular Step Error Or Error message is coming U can use-
 On Error Resume next [this will keep on executing from next line of code without stopping the script]
But If you are not sure after which line of code Error is occurring then Use Recovery Scenario and select " continue with execution" as ur Post Recovery Scenario.

In order to create the Recovery scenario follow the below steps -
Go to the Resources-> Recovery Scenario Mngr->Wizard will be launched -> select popup window/msg as ur triggering Event->then capture the error msg from Pointing Hand either with text Or Title of Error Message in order to clicking on the buttons u want to hit on that message as you operation -> Then Opt for Post recovery scenario as Continue with execution-> Save the scenario with Meaning full name & associate it to the script. it will automatically be called when error occurred...
 That's All..
Satya.

  Was this answer useful?  Yes

Mlee

  • Jul 13th, 2011
 

Hi,
There is STOP RUN option in Qtp we can use that.then u want father then we need to use recovery Scenario

  Was this answer useful?  Yes

smarth

  • Jul 15th, 2011
 

It would be good if we can go for looping. I will keep executing the same procedure/function till the cycle end best effort is to use a Do while loop for this.

  Was this answer useful?  Yes

nadir

  • Jul 15th, 2011
 

The best approach is to use the do while statement. It will keep it looping until the condition is true.

Code
  1. do

  2. <Statement>

  3. While<Condition>

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions