Micro Focus QTP (UFT) Forums
how to automate the execution of the script... - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: how to automate the execution of the script... (/Thread-how-to-automate-the-execution-of-the-script)



how to automate the execution of the script... - manishnangalia - 07-09-2012

I have written code to test if an url is entered , the web page is opened with the corresponding url. There are nearly 400 urls and I have coded for it. It is working fine for almost all except for 3 or 4 urls where I am seeing 'General Run error' dialog box. Because of this dialog box, the script is not running continuously without my personal intervention to click on 'Skip button' when the dialog box appears. I have to attend all the time the script is running , which takes nearly 3 hours. Can some one help me suggesting how to handle this situation.


RE: how to automate the execution of the script... - K Gaurav Varshney - 07-09-2012

Write ur code in such a manner that if error comes then it should handle it then moves to the next URL.

For eg.
Code:
Browser("").AddressBar("").Set URL1
          If Window("").Dialog("Error").Exist then
              Dialog("Error").Button("Ok").Click
              Reporter.reportevent micFail, "URL1","showed run time error"
          Else
              reporter.ReportEvent micPass,"URL1","opened successfully"
Then write same code for other RLs aswell

Regards,
Gaurav


RE: how to automate the execution of the script... - Ankesh - 07-09-2012

Add a recovery scenario. This will help if you are not sure when the pop will appear.


RE: how to automate the execution of the script... - Tarik Sheth - 07-09-2012

Hi,

First, Do you know on which URL you are getting General Run Error and what is the reason.
If it is repititive then you can modify the code to avoid as this looks like code or method issue.