Quality Testing

Quality is delighting customers

Dear All

Please share your knowledge regarding following question

1>How error are handled in QTP 

2> Is it possible to use On error Goto 5 "specified line number "

3>will qtp supports this kind if error handling

i have code like this 

On error goto errorhandle:

<code>

errorhandle: 

msgbox "found error"

Finish

 

Please shared your knowledge on this ,,

thanks for your reply....

Views: 877

Reply to This

Replies to This Discussion

1> make use of Recovery Scenario Manager
Thanks ..........
In recovery scenario is it possible to find error line number (Q:2)
My scenario is if i find any error in a script i need to execute mentioned line number will it possible.

pls refer below link

http://www.softwaretestinggenius.com/hotarticles.php?mode=details&a...

 

regards

 

Venkatesh.M

 

Thanks a lot ......
but i need to do in scripting can you please share knowledge on this

Hi,

In order to handle this issue,QTP provides "err" Object.

err.number retunrs error number

err.description returns the description abt error.

 

ex:

on error resume next 'to enable error description

1.msgbox "hi"

2.msgbox "hi hi"

3.saywelcome

4.msgbox "hi hi hi"

5.function saywelcome

6.msgbox "welcome"

7."to new world"

8.msgbox "error number is "&err.number &"error description is..."&err.desciption 

9.end function

10.on error goto 0 'which is used to to disable error handling

 

 

check it once

Regards Suresh

In Qtp error handling can be done by Recovery scenario and on erro resume next

but i have a doubt where exactly we use recovery scenario and where exactly we use on error resume next.

please share ur feelings

Hi Suresh,

 

Recovery Scenario can be used to handle unexpected errors during runtime

On error resume next can be used to handle expected errors during runtime

 

Mythri 

For Error Handling in QTP you watch the below Link:

http://www.gcreddy.com/2010/01/xml-scripts.html

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2018   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service