How to Start with Selenium Debugging?

โšก Smart Summary

Breakpoints and Startpoints in Selenium IDE let testers pause and resume execution at chosen points. They simplify debugging, isolate failing steps, and speed up verification of login flows and validation logic during automation testing.

  • ๐Ÿ“Š Purpose: Breakpoints halt execution mid-script so testers can inspect state and verify each command.
  • ๐ŸŒ Startpoint Use: Startpoints let scripts resume from a chosen command, useful when re-running tests after login.
  • ๐Ÿ› ๏ธ Two Methods: Set breakpoints via right-click, the Actions menu, or shortcuts B and S.
  • โœ… Best Practice: Use multiple breakpoints to narrow defects, but limit scripts to one startpoint.
  • ๐Ÿงช Debug Workflow: Combining startpoints with breakpoints saves time when validating long flows.

Selenium Debugging

Breakpoints in Selenium

Breakpoints in Selenium are used to check the execution of your code. Whenever you implement a breakpoint in your code, the execution will stop right there. This helps you to verify that your code is working as expected. Breakpoints in Selenium help in debugging. Breakpoints are usually shown in the UI along with the source code.

Before looking at examples, it helps to know the two ways Selenium IDE lets you place these breakpoints.

Methods to Implement Breakpoints in Selenium

There are two methods to set breakpoints in Selenium WebDriver:

  • In the first method,
  • Right click on the command and select the ‘Toggle Breakpoint’. You can also use the shortcut key “B” from the keyboard.
  • You can set a breakpoint just before the Test Case you want to examine.
  • After setting breakpoints, click on the Run button to run the test case from the start to the breakpoint.
  • Repeat the same step to deselect the Breakpoint.
  • In the second method,
  • Select Menu Bar -> ‘Actions’ -> select the Toggle Breakpoint. To deselect, repeat the same step.

How to Implement Breakpoints in Selenium

Now let us apply both methods to a real example so the steps are easy to follow.

To demonstrate, let us consider the following scenario. Validate the ‘username’ and ‘password’ when clicked on the ‘Sign in’ button.

First Method

Step 1) Open Selenium IDE and browser

Launch Firefox and Selenium IDE.

Step 2) Enter the base URL

Type the Base URL as —> https://demo.guru99.com/test/newtours/

Step 3) Click on the Record button

Navigate to the record button marked in the red box as shown in the screenshot below.

Implement Breakpoints In Selenium

Step 4) Toggle the Breakpoint

  1. Under the tab “Table”, right click on the command (“clickandwait”).
  2. Under the “Command” column, select the ‘Toggle Breakpoint’. You can also use the shortcut key “B” from the keyboard.

Implement Breakpoints In Selenium

When you toggle the breakpoint, it will open another window as shown below. You will see two yellow pipe marks in front of “clickandwait” under the ‘Command’ column.

Implement Breakpoints In Selenium

It indicates two things,

  • The yellow pipe shows that the test case was paused at that point. So when you click the ‘Run’ button, the execution starts from the beginning of the test case to this point. After that, one needs to start executing manually.
  • A Test Script can have multiple breakpoints which can be set in the same manner as shown above.

Second Method

Step 1) Follow the above steps 1, 2 & 3 mentioned in the First method.

Step 2) In this step,

  1. Click on the option ‘Actions’ from the Menu bar and
  2. Click on the option “Toggle Breakpoint”.

Implement Breakpoints In Selenium

This is all about the breakpoints in Selenium.

Start Point in Selenium

With breakpoints covered, the complementary feature is the Start Point, which controls where execution begins rather than where it pauses.

In Selenium, the Start Point indicates the point from where the execution should begin. The Start Point can be used when you want to run the test script from the middle of the code or a breakpoint.

To understand this, let us take an example of the login scenario. Suppose you have to login into the website and perform a series of tests and then try to debug one of those tests.

In this case, you have to login once and then re-run your tests as you are developing them. You can set the Start Points after the login function. So every time you perform a new test it will begin executing after the login function.

The table below summarizes the key differences between a Breakpoint and a Startpoint at a glance.

Aspect Breakpoint Startpoint
Purpose Pauses execution at a chosen command Marks the command where execution begins
Shortcut key B S
Allowed per script Multiple Only one
Visual marker Two yellow pipes Green triangle
Typical use Inspect state and isolate defects Resume runs after login or setup

Methods to set Start Point in Selenium

Like breakpoints, a Start Point can be set in two ways.

The Start Point can be selected by two methods:

1. Right click on any command under the ‘Command’ column in Selenium IDE. Select the option ‘Set/Clear Start Point’. You can also use the shortcut key ‘S’ from the keyboard to mark the start point (shown as a green triangle in the screenshot). Repeat the same step to deselect the Start Point.

2. Click “Actions” -> ‘Set/Clear Start Point’. This will select the Start Point, or repeat the same step to deselect it.

How to Set Start Point in Selenium

Let us see the first method with an example.

First Method

Step 1) Launch Firefox and Selenium IDE.

Step 2) Type the Base URL as —> https://demo.guru99.com/test/newtours/

Step 3) Click on the Record button (marked in the red rectangle box in the screenshot below).

Set Start Point In Selenium

Step 4) In this step,

  1. Under the tab “Table”, right click on the command “clickandwait”.
  2. Now select the option ‘Set/Clear Start Point’. You can also use the shortcut key “S” from the keyboard to select the same Set/Clear Start Point.

Set Start Point In Selenium

When you click on Set/Clear Start Point, it will open another window. In this window, you can see the green Triangle symbol before “type” under the ‘Command’ column.

This triangle symbol indicates that the test case starts at this point. So when you click the ‘Run’ button, the execution starts from that point onwards.

Set Start Point In Selenium

Note: There can only be one Start Point in a single test script. Also, the Start Point is dependent on the currently displayed page. The execution will fail if the user is on the wrong page.

Second Method

  1. Follow the above steps 1, 2 & 3 mentioned in the previous (First) method.
  2. Next, follow the following steps,
  1. Click on the option ‘Actions’ from the Menu bar and
  2. Click on the option “Set/Clear Start Point”.

Set Start Point In Selenium

FAQs

A Breakpoint pauses execution at a chosen command so testers can inspect behavior. A Startpoint marks where execution begins. Scripts may hold many breakpoints, but only one startpoint.

Press “B” to toggle a Breakpoint on the selected command and “S” to set or clear a Startpoint. These shortcuts speed up debugging compared with right-click menus.

A Startpoint depends on the currently displayed page. If the browser is not on the expected page, the locator will not match and the test will fail.

AI-powered test tools analyze failures, suggest where to place breakpoints, and identify unstable locators. They learn from prior runs to recommend startpoints near recurring issues.

Yes. Modern AI assistants inspect logs and step traces to predict useful breakpoint locations. They surface candidate commands near assertion failures so testers pause at the right step.

Summarize this post with: