Execute and Debug a Test Case

You can run a single test case or a test suite in Katalon Studio.

Execute a Test Case or a Test Suite

To run test:

  1. In Tests Explorer, open a test case or test suite.

  2. In Katalon Toolbar, in the drop-down list of button Run, select an environment to run the test case. If you click on the Run button, the test case is executed using the default browser defined in Execution Settings.

Test Environments

In the drop-down list of button Run, select one of the following supported environments to run your test case or test suite:

  • Browsers: Select one of the supported browsers (Chrome, Firefox, IE, Safari, Edge Chromium, Headless Chrome, Headless Firefox)

  • Mobile: Select either Android or iOS to launch the connected devices. Then select a device among those listed ones.

    Before executing your Mobile test, you're required to set up the environment for mobile testing on Windows or macOS machine.

    Troubleshooting: If your device is not found, make sure the device's Developer Mode is turned on, try to unplug, and reconnect several times until you are prompted to accept/trust this device.

  • Remote: Select a remote environment to run tests.

    You need to set up a default configuration for the remote environment in Project Settings. Refer to Introduction to Desired Capabilities for more details.

  • Custom: Select it from the drop-down list when you have already set up a custom environment.

    Refer to Custom Execution for preparing a remote environment in Project Settings.

Job Progress

The Job Progress is triggered automatically to show the progress while your test case or test suite is being executed.

Troubleshooting

Some factors can affect your execution:

You can also refer to this document for troubleshooting issues relating to web test execution.

Debug a test case

Creating automation test cases is a repetitive task that requires a lot of editing and re-running test cases. In many automation tools, when a test case fails and you make certain changes to the script, you usually have to execute the whole script all over again to make sure the test is executed as expected.

To save your precious time from tedious repetitive re-running all unnecessary steps for debugging and to make debugging easier, Katalon Studio provides the following utilities:

  • Debug: Run from here
  • Debug: Enable/Disable steps
  • Debug mode
  • Debug from here

Requirements

  • An active Katalon Studio Enterprise license

Debug: Run from here

With this feature, you can resume the existing execution quickly. Katalon Studio currently supports Run from here with Chrome, Firefox, and Edge Chromium (Edge Chromium is supported in v7.3 and later) only. To use it, from the Manual view of a test case:

  1. Start a browser with the Open Browser step, or you must have a currently running browser.

  2. Make sure this browser's session is NOT terminated when the execution finishes (Go to Project/Settings/Execution and uncheck the Terminate... options in Post-Execution Options based on your testing needs)

  3. In the Manual view of the test case, right-click on a step, select Run from here and select one of the currently running browser instances to execute your test.

    If there are no running browser instances that are previously launched in Katalon Studio, Run from here is disabled.

Debug: Enable or Disable steps

Katalon Studio allows you to enable or disable one or more test steps before executing the test case to skip unwanted steps during execution. You can use the provided keyboard shortcuts to perform the actions.

  • For Windows:  Ctrl+D (disable) and Ctrl+E (enable) on selected steps.
  • For macOS: command+/ (disable) and option+command+/

Debug mode

The Debug mode is designed to make debugging easy to use, allowing investigating the root causes more quickly. The following steps present how to debug a test case:

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

    Script view Katalon Studio

  2. Double-click on the leftmost side of the script editor to mark a breakpoint. A breakpoint is where Katalon Studio pauses the test execution for you to start debugging.

    mark a breakpoint for the step

  3. Choose a browser for Debug from the main toolbar.

  4. Confirm (select Yes) when being asked to display the Debug perspective.

  5. The Debug perspective provides convenient options for debugging purposes. You can:

    • Navigate execution using commands from the debug toolbar

    debug toolbar

    Where:

    Command Description
      Resume debugging
      Suspend debugging
      Terminate debugging
      Disconnect
      Step into the current code block
      Step over the current code block
      Return from the current code block
      Run to a specific line
    • Track values of variables using Watch utilities.**

    Watch utilities

    Where:

    View Description
    Variables You can view all variables associated with the current debugged action using Variables View, which is similar to Variables View in Eclipse. Refer to this guide for more details.
    Breakpoints You can view all breakpoints using Breakpoints View, which is similar to Breakpoints View in Eclipse. Refer to this guide for more details.
    Expressions You can inspect data using Expressions View, which is similar to Expressions View in Eclipse. Refer to this guide for more details.

Debug from here

Introduced in version 7.5.5.

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

  1. Start a browser with the Open Browser step, or you must have a currently running browser

  2. Make sure this browser's session is NOT terminated when the execution finishes (Go to Project/Settings/Execution and uncheck the Terminate... options in Post-Execution Options based on your testing needs)

  3. Open a test case in its Script view and double-click on the leftmost side of the script editor to mark a breakpoint. A breakpoint is where Katalon Studio pauses the test execution for you to debug.

  4. Switch to the test case's Manual view, right-click on a step, select Debug from here and select one of the currently running browser instances to execute your test.

    If there are no running browser instances that are previously launched in Katalon Studio, Debug from here... is disabled.

See also:

Feedback