Skip to main content

Debug a test case in Katalon Studio

Creating automation test cases is a repetitive task that often requires editing and rerunning the same test many times. When a test case fails and you update the script, rerunning the entire flow can be time-consuming.

To make debugging easier and reduce unnecessary reruns, Katalon Studio provides the following utilities:

requirements
  • License: an active Katalon Studio license.
  • Project configurations: Go to Project > Settings > Execution, and clear Terminate browser/application after a test case/suite finishes option under Post-Execution Options.
  • Test case readiness:
    • The test case for debugging must be opened in either Manual/Script view.
    • (For session-based debugging) A browser instance (Chrome, Firefox,...) for the debugging test case must still be running.

Debug: Run from here​

With this feature, you can quickly resume an existing execution. Katalon Studio currently supports Run from here with Chrome, Firefox, and Edge Chromium only.

To use it from the Manual view of a test case:

  1. Start a browser with the Open Browser step, or use a browser instance that is already running.

  2. Make sure the browser session is not terminated when the execution finishes.

    Post-execution options in Katalon Studio
  3. In the Manual view of the test case, right-click a step, select Run from here, then choose one of the currently running browser instances.

    note
    Run from here option in Katalon Studio

Debug: Enable or Disable Steps​

Katalon Studio allows you to enable or disable one or more test steps before execution so you can skip unnecessary steps while debugging.

  • For Windows, use Ctrl+D to disable and Ctrl+E to enable selected steps.
  • For macOS, use command+/ to disable and option+command+/ to enable selected steps.
Enable or disable steps to debug

Debug mode​

The Debug mode in Katalon Studio helps you investigate root causes more quickly. To debug a test case:

  1. Open a test case and switch to the Script view.

    Script view in Katalon Studio
  2. Double-click the left side of the script editor to mark a breakpoint. A breakpoint is where Katalon Studio pauses execution so you can start debugging.

    Set a breakpoint in the script editor
  3. Choose a browser for Debug from the main toolbar.

    Run debug from the toolbar
  4. When prompted, select Yes to display the Debug perspective.

    Confirm the debug perspective
  5. Use the Debug perspective to inspect and control the execution.

    • Navigate execution using commands from the debug toolbar.

      Debug toolbar in Katalon Studio
    • The following commands are available:

      CommandDescription
      Resume debugging iconResume debugging
      Suspend debugging iconSuspend debugging
      Terminate debugging iconTerminate debugging
      Disconnect iconDisconnect
      Step into current code block iconStep into the current code block
      Step over current code block iconStep over the current code block
      Return from current code block iconReturn from the current code block
      Run to a specific line iconRun to a specific line
    • Track variable values using Watch utilities.

      Watch utilities in Katalon Studio
    • The following views are available:

      ViewDescription
      VariablesView all variables associated with the current debugged action. This works similarly to Variables View in Eclipse. See the Eclipse guide.
      BreakpointsView all breakpoints. This works similarly to Breakpoints View in Eclipse. See the Eclipse guide.
      ExpressionsInspect data using Expressions View. This works similarly to Expressions View in Eclipse. See the Eclipse guide.

Debug from here​

To use Debug from here with Chrome, Firefox, or Edge Chromium:

  1. Start a browser with the Open Browser step, or use a browser instance that is already running.

  2. Make sure the browser session is not terminated when the execution finishes.

    Uncheck post execution options
  3. Open a test case in Script view and double-click the left side of the script editor to mark a breakpoint.

    Breakpoint in script view
  4. Switch to the test case's Manual view, right-click a step, select Debug from here, then choose one of the currently running browser instances.

    note
    Debug from here option in Katalon Studio

See also:

Was this page helpful?