Micro Focus QTP (UFT) Forums

Full Version: How to close QTP session automatically if any runtime error occurs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

We are using QTP(Ver.9.5) for testing our Oracle 10g based product (Forms and Reports). I created many test cases and the cases are calling as a batch. Many batches are called in order through VB script (.vbs file).

My problem is if any test case is stopped with an Oracle error or a QTP runtime error, I have to log the error and QTP should continue with next batch automatically. Now, the Oracle error has been handled but when a QTP runtime error occurs, it stops there.

My requirement is if any QTP runtime error occurs, it should not stop there and should continue automatically by closing the error QTP session and its related opened Web based windows of Oracle.

Could you please advise me in this issue ?

[/align]Thanks in advance,
Remesh
Hi ,
Well u can use this code:
use this below mentined code after nameing ur function
Code:
public function abc()

on error resume next
some code
.
.
.
at the end use thsi
if err.number<>0
reporter.reportevent micfail, err.number,err.description
else
reporter.reportevent micpass,"None of the Runtime Error occoured"
end if

if u use this code ur runtime error will be locked and ur Execution will not stop for sure.

Regards,
Amit