Sunday, March 22, 2009

BreakPoints in QTP

Hi ,

Here i am providing the brief overview on "BreakPoints" in QTP.

Do understand the use of breakpoints & start implementing these accordingly.

Using Breakpoints :
We can use breakpoints to instruct QuickTest to pause a run session at a predetermined place in a component or function library. QuickTest pauses the run when it reaches the breakpoint, before executing the step. we can then examine the effects of the run up to the breakpoint, make any necessary changes, and continue running the component or function library from the breakpoint.
You can use breakpoints to:
* suspend a run session and inspect the state of your site or application.
* Mark a point from which to begin stepping through a component or function library using the step commands
* We can set breakpoints, and we can temporarily enable and disable them. After we finish using them, we can remove them from your component or function library.
Note: Breakpoints are applicable only to the current QuickTest session and are not saved with your component or function library.


Operations we can perform on Breakpoints:
* Setting Breakpoints
* Enabling and Disabling Breakpoints
* Removing Breakpoints


* Setting Breakpoints:
By setting a breakpoint, we can pause a run session at a predetermined place in a component or function library. A breakpoint is indicated by a filled red circle icon in the left margin adjacent to the selected step.
To set a breakpoint:
Perform one of the following:
*Click in the left margin of a step in script/function library where you want the run to stop
*Click a step and then:
Click the Insert/Remove Breakpoint button
Choose Debug > Insert/Remove Breakpoint
The breakpoint symbol is displayed in the left margin of the script or function library.
Note: Breakpoints are applicable only to the current QuickTest session and are not saved with your component or function library.


* Enabling and Disabling Breakpoints :
We can instruct QuickTest to ignore an existing breakpoint during a debug session by temporarily disabling the breakpoint. Then, when you run our component or function library, QuickTest runs the step containing the breakpoint, instead of stopping at it. When we enable the breakpoint again, QuickTest pauses there during the next run. This is particularly useful if your component or function library contains many steps, and you want to debug a specific part of it.
We can enable or disable breakpoints individually or all at once. For example, suppose we add breakpoints to various steps throughout your component or function library, but for now you want to debug only a specific part of your document. We could disable all breakpoints in your script or function library, and then enable breakpoints only for specific steps. After you finish debugging that section of your document, you could disable the enabled breakpoints, and then enable the next set of breakpoints (in the section you want to debug). Because the breakpoints are disabled and not removed, we can find and enable any breakpoint, as needed.
An enabled breakpoint is indicated by a filled red circle icon in the left margin adjacent to the selected step.
A disabled breakpoint is indicated by an empty circle icon in the left margin adjacent to the selected step.
Note: Breakpoints are applicable only to the current QuickTest session and are not saved with your component or function library.


We can:
Enable/disable a specific breakpoint
Enable/disable all breakpoints
To enable/disable a specific breakpoint:
Click in the line containing the breakpoint you want to disable/enable.
Choose Debug > Enable/Disable Breakpoint or press Ctrl+F9. The breakpoint is either disabled or enabled (depending on its previous state).
To enable/disable all breakpoints:
Choose Debug > Enable/Disable All Breakpoints or click the Enable/Disable All Breakpoints button. If at least one breakpoint is enabled, QuickTest disables all breakpoints in the component or function library. Alternatively, if all breakpoints are disabled, QuickTest enables them.


* Removing Breakpoints:
You can remove a single breakpoint or all breakpoints defined for the current component or function library.
To remove a single breakpoint:
Perform one of the following:
Click the breakpoint.
Click the line in your component or function library with the breakpoint symbol and:
Click the Insert/Remove Breakpoint button.
Choose Debug > Insert/Remove Breakpoint.
The breakpoint symbol is removed from the left margin of the QuickTest window.
To remove all breakpoints:
Click the Clear All Breakpoints button, or choose Debug > Clear All Breakpoints. All breakpoint symbols are removed from the left margin of the QuickTest window.

2 comments:

  1. Can we save the OTP script with breakpoints?

    ReplyDelete
  2. Hi Yamini,

    No, we can't save QTP script with a Breakpoint.

    Note: Breakpoints are applicable only to the current QuickTest session
    and are not saved with your test or function library.

    You can set breakpoints, and you can temporarily enable and disable
    them. After you finish using them, you can remove them from your test
    or function library.

    Cheers,
    Sreekanth

    ReplyDelete