Thursday, 16 January 2014

Explain Err.Number in QTP

Err object is very important in QTP. We can handle errors using this object. Whenever you think that error might occur, you can check if the error really occured or not using err.number

Example -

on error resume next
a = 2/0
'Above statement contains error - divide by zero.

if err.number <> 0 then
print "Error number is " & err.number & err.description
end if

Remember that you can use on error resume next anywhere and any number of times in the code.

To stop suppressing errors in QTP code you can use below statement.

On error goto 0
After this statement, if any error occurs, script will prompt you with the error message.

Please give your inputs, suggestions, feedback to Us about above QTP topic. We value your thoughts.

No comments:

Post a Comment

Please Leave your reply. We value your feedback and inputs

Best QTP Books

Everything About QTP

Hello Friends,
You can find QTP study material, Multiple choice questions (mcq), QTP question bank, QTP question papers, QTP notes, QTP questionnaire, scenario based QTP interview questions, QTP tutorial and QTP training on this site.

If you are a fresher or experienced QTP professional with (1/2/3/4) years of experience, this blog is just for you.