Sunday 27 October 2013

DEBUGGING in QTP



Debugging is the process of locating and fixing the error in the scripting code.

We can set the breakpoint in the program to stop program execution and to isolate the defects.

After stops at breakpoint, we can see the debug viewer to check and modify the values of VBscript objects and value.



Debugging steps using breakpoint


We can insert the breakpoints from which step we want to debugging for verify the function working properly or not.

-> Insert Break point from where we want to use ( Debug -> Insert/Remove Breakpoint ( F9)

-> Run the record

-> QTP stop(Break) the step still where we insert the breakpoint.

-> Now From debug viewer, we can see/modify the variable value ( View -> Debug Viewer)

    -> Watch tab :

    -> Variables tab :

    -> Command tab :

-> While in Recording the test and break the test, we can debugging the each an every step using below options,

     -> Step Into :  (Debug -> Step into ) (F11)
                     ->    Its executed step by step line the text.
             -> If we have function or Action in the text, its go                         in to the function or Action and execute the step by                          step line.
             -> The QTP window visible the step by step test,function and Action.

    -> Step Out  :  ( Debug -> Step Out )
             -> Its executed step by step
                     -> If we have function or Action in the the text, and cursor placed in first line of the function or Action from the test. and will execute the still end of the function.
                      -> the cursor is paused first line of the statement, its only visible in QTP window. Then its process still end of the function, its not visbile in QTp window.But the step by step in test is visible.

    -> Step over : (Debug -> Step Over)

             -> Its executes step by step.
             -> IF we have function or Action in the test, its execute the whole statement in the function or Action. its not wait still we click the debug-> step over in each an every time.
             -> Its execute the whole function or Action, but its not visble in QTP window.But the step by step in test is visble.


Use this link for brief explanation -> http://www.qtphelp.com/2011/04/qtp-debugging-options.html           

No comments:

Post a Comment