Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Batch test exception handling
#1
Solved: 9 Years, 8 Months ago Wink 
I am running a batch of QTP (test automation tool) scripts overnight. Could some one send me an error handling vb script code snippet that I may insert in each script which automatically exists any script that encounters an environmental or any other run time error in it's run but it should complete the run and logs the errors in the test results.


Thanks in Advance
Reply
#2
Solved: 9 Years, 8 Months ago
Hi,

You can use "On error resume next" at the begining of each script and at the end of the script check the error number and log the result.Below is the sample code

On error Resume Next

--lines of code
--
--

Code:
If err.Number <> 0 Then
SystemUtil.Closeprocessbyname "Iexplorer.exe"
Reporter.reportevent micfail ,"",""
ExitTest
End If

This can be done using a recovery scenario also..

Let me know if you have any questions on this..

- Vinod
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] SelectRow and Exception robertosalemi 1 2,314 03-23-2016, 10:36 PM
Last Post: robertosalemi
Rolleyes QTP pop up window handling piyush8793 3 16,399 10-15-2015, 11:03 PM
Last Post: Venkateswarluponna
  QTP is getting closed after executing first test in MTM(Batch) Shyama 0 2,036 10-07-2014, 07:26 PM
Last Post: Shyama
  External component has thrown an exception. mharps 1 6,945 05-28-2014, 10:07 AM
Last Post: mharps
  Handling .NET framework menu in webpage using QTP 10 vishnu1067 0 2,202 05-15-2014, 05:30 PM
Last Post: vishnu1067

Forum Jump:


Users browsing this thread: 1 Guest(s)