Using Breakpoints | TestComplete Documentation (2024)

About Breakpoints

A breakpoint is a location in your script or keyword test where you want the script or test to pause during execution. Once execution is paused, you can check the state of the test, its output and its variables.

Breakpoints only function if the Using Breakpoints | TestComplete Documentation (1)Enable Debugging item of the Debug toolbar is checked. If this item is unchecked, the test execution will not pause using breakpoints.

Note:During distributed testing, TestComplete runs in silent mode on remote computers, and its debugger is turned off. Breakpoints in remote projects are ignored.

In the Breakpoints panel, you can view and manage breakpoints of the entire project suite. Each breakpoint can be enabled or disabled and made dependent on a condition - like a pass count or a conditional expression.

When a breakpoint is enabled with the optional condition set to true, and the script or keyword test execution reaches it (in a normal run or using the debugger), execution will stop just before the breakpoint line or operation (if you debug a keyword test). This line or operation will be highlighted in the Code Editor or Keyword Test editor. If a breakpoint is disabled, TestComplete does not stop the test execution.

In keyword tests, breakpoints can reside on any operation. However, in script code the breakpoints have to be on an executable script line, not a declaration, comment or blank line. Otherwise, the breakpoint is always disabled.

At any stop you can check the state of the tested application, the test output, variables, objects, their properties and so on. Using breakpoints is the easiest and most flexible way to preset spots in your tests where you want to run these types of checks.

To check the variable, parameter and property values, you can use the Watch List and Locals panels and the Evaluate dialog. See also Evaluating Expressions.

After the check is over, you can continue tracing the test using various debugger commands. See Debugging Tests - Overview for more information.

Setting Breakpoint

To set a breakpoint on a line of source code in the Code Editor:

  • Select the line in the Code Editor.

  • Click the left margin of the line.

    -- or --

    Press the Toggle breakpoint shortcut. (By default, F9. See Key Mapping for more information on how to change this shortcut).

Similarly, you can set a breakpoint on an operation in a keyword test:

  • Select the desired operation in the Keyword Test editor.

  • Click the indicator area to the left of the operation or press the Toggle breakpoint shortcut (by default, F9. See Key Mapping).

Note:You cannot set breakpoints on grouping nodes in the Keyword Test editor.

To set a breakpoint from the Call Stack panel:

  • Open the Call Stack panel that contains a sequence of script routine calls and keyword tests that led to the current execution point.
  • Right-click the desired routine or keyword test and select Insert Breakpoint from the context menu.

The breakpoint will be set on the script line or operation that follows the current execution point of the selected script routine or keyword test.

When you set a breakpoint, the script line or the operation of a keyword test is highlighted in red, and the Using Breakpoints | TestComplete Documentation (2) mark appears in the left margin of the breakpoint line (or operation). Setting breakpoints is a toggle, so repeating the “set” on the same line will remove the breakpoint.

Yellow breakpoints Using Breakpoints | TestComplete Documentation (3) indicate that they are set on script lines where TestComplete may or may not be able to pause the test execution (for example, comment lines).

Note:Sometimes, when you set a breakpoint, it appears with the hollow glyph Using Breakpoints | TestComplete Documentation (4) instead of the solid glyph Using Breakpoints | TestComplete Documentation (5). This means that test debugging is disabled in TestComplete. To enable test debugging, select Debug > Enable Debugging from the TestComplete main menu.

While your test is running, you can switch to TestComplete just as you would switch to any Window’s application, and set a breakpoint. The new breakpoint will be set, and your script will pause when it reaches the breakpoint.

TestComplete also contains the Runner.Pause method that acts as a scripting analogue to breakpoints. A call to this method halts the test execution on the next script line as if this line has a breakpoint. Also, the script debugger is automatically activated if the Pause test execution on posting an error option is enabled. See Activating Debugger From Tests for more information.

Working With Breakpoints

To work with the list of all breakpoints for the current project suite, use the Breakpoints panel. This panel allows you to add, edit, delete, enable or disable breakpoints. You can also modify breakpoint properties using the Breakpoint Properties dialog. To call it, right-click the breakpoint icon in the Code Editor (or in the Keyword Test editor) and select Properties from the ensuing context menu. This menu also holds the Enabled item that controls whether the breakpoint is enabled or disabled. Disabled breakpoints are shown with the Using Breakpoints | TestComplete Documentation (6) mark. Disabling breakpoints is useful if you want to deactivate the breakpoint temporarily.

About Conditional Breakpoints

Besides setting ordinary breakpoints, which pause test execution when the debugger reaches them, you can make breakpoints pause test execution only if certain conditions are met. This implies assigning either conditional expressions, or pass counts (however, using both on one breakpoint disables it). See Conditional Breakpoints. Conditional breakpoints are shown with the Using Breakpoints | TestComplete Documentation (7) or Using Breakpoints | TestComplete Documentation (8) mark. Using Breakpoints | TestComplete Documentation (9) means the breakpoint is a disabled conditional breakpoint.

If you place the mouse cursor over the breakpoint mark (Using Breakpoints | TestComplete Documentation (10) , Using Breakpoints | TestComplete Documentation (11) or Using Breakpoints | TestComplete Documentation (12)) the hint will display the breakpoint’s conditional expression or pass count.

See Also

Conditional Breakpoints
Stepping Through Test
Running to the Cursor
Setting Next Execution Point
Evaluate Dialog
About Watch List Panel
Call Stack Panel
Debugging Tests - Overview
Debugging Tests

Using Breakpoints | TestComplete Documentation (2024)

FAQs

Using Breakpoints | TestComplete Documentation? ›

Working With Breakpoints

How do you use breakpoints effectively? ›

Place them strategically at points of interest in the code where you suspect issues. Use conditional breakpoints to halt execution only when specific conditions are met. Utilize breakpoints to inspect variable values, stack traces, and execution flow.

What are breakpoints used for? ›

Breakpoints are one of the most important debugging techniques in your developer's toolbox. You set breakpoints wherever you want to pause debugger execution. For example, you may want to see the state of code variables or look at the call stack at a certain breakpoint.

What is a breakpoint in automation testing? ›

Breakpoints in automation testing help us to halt execution at a particular point in our code. When you apply a breakpoint at some point in our code, it helps debug the code step by step from that point.

What is the difference between debugger and breakpoint? ›

The breakpoint appears as a red dot in the left margin next to the line of code. The debugger suspends execution just before the line runs. Breakpoints in Visual Studio provide a rich set of functionality, like conditional breakpoints and tracepoints.

What are the examples of breakpoints? ›

For example, a desktop breakpoint might range from 1200px to 1400px — meaning that the desktop layout will be shown on any screen with the width in that range. As the ritual.com website is resized, it goes through 2 different breakpoints. As a result, the layout changes from a 4-column to a 2-column layout.

What are the best responsive breakpoints? ›

Common top breakpoints in responsive web design are 320px (small phones), 768px (tablets), and 1024px (larger tablets/desktops). These address various device sizes, ensuring a well-adapted user experience across a range of screens.

How many breakpoints should I use? ›

Each web page should have a minimum of three breakpoints (mobile, tablet, and desktop). As mentioned above, we recommend five breakpoints for maximum device flexibility. In rare circ*mstances, designers might also need to consider how websites perform on iOS vs. Android devices.

What are responsive breakpoints? ›

Common Responsive Breakpoints

To work with media queries, you need to decide on the “responsive breakpoints” or screen size breakpoints. A breakpoint is the width of the screen where you use a media query to implement new CSS styles.

How are breakpoints determined? ›

Breakpoints are set through a rigorous examination of data by various national and international organizations which we will discuss in a later post. Determining the optimal value at which a breakpoint should be set is multifactorial, requiring a multidisciplinary approach to incorporate data from bench and bedside.

What is breakpoint in API? ›

Breakpoints are event triggers which, when the breakpoint's conditions are satisfied, will halt execution of the target and break into the debugger. Breakpoints allow the user to analyze and perhaps modify the target when execution reaches a certain point or when a certain memory location is accessed.

What is the difference between breakpoint and start point? ›

Break points help you check code structure and execution. When you apply a breakpoint to any code it debugs the code step by step allowing you to verify the code. Start points help you identify the point from which execution must begin. Start points can run a test script from the middle of a code or a breakpoint.

What is breakpoint in developer tools? ›

Breakpoints let you pause your code in the middle of its execution, on an optional condition, and examine all values at that moment in time. Logpoints let you log messages to the Console without pausing the execution. Breakpoints and logpoints are an efficient alternative to debugger; statements and console.

How do you debug using breakpoint? ›

A breakpoint interrupts script execution just before the statement at which the breakpoint is set. While script execution is interrupted, you can examine and modify the values of variables and use other debugger commands. Breakpoints cannot be set for the Terminate event.

What are the different breakpoints for different devices? ›

While there is no hard and fast rule for what breakpoints should be used, values of common CSS breakpoints are 320px or 480px (for mobile phones), 768px (for tablets), and 1920px (for desktop computers).

What is checkpoint vs breakpoint? ›

Breakpoints can be set on the fly and don't require a deploy. Checkpoints are a snapshot of all objects in an org at a certain point in time. Checkpoints have to be redeployed every time they're set. To set line breakpoints, open a .

How can breakpoints be used to debug a program? ›

A breakpoint instructs the debugger to stop at a particular code location in the user's program, returning control of the debugger to them. The user may then inspect the application's state. Breakpoints are by far the most common type of debug event that developers use.

What are good breakpoints for media queries? ›

Media Query Breakpoints

Some of the most popular ones are 1920×1080, 1366×768, and 360×640. Alternatively, you may use different frameworks' breakpoints. Since they are optimized for the mobile-first approach, use them as references when developing for larger-screen devices.

Top Articles
Latest Posts
Article information

Author: Saturnina Altenwerth DVM

Last Updated:

Views: 6037

Rating: 4.3 / 5 (64 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Saturnina Altenwerth DVM

Birthday: 1992-08-21

Address: Apt. 237 662 Haag Mills, East Verenaport, MO 57071-5493

Phone: +331850833384

Job: District Real-Estate Architect

Hobby: Skateboarding, Taxidermy, Air sports, Painting, Knife making, Letterboxing, Inline skating

Introduction: My name is Saturnina Altenwerth DVM, I am a witty, perfect, combative, beautiful, determined, fancy, determined person who loves writing and wants to share my knowledge and understanding with you.