Clear Web Cookies

The Clear Web Cookie block is used to remove one or all cookies that were previously set in the current browser session. It only works with browser windows that were opened using the Start Web Browser block. Browsers started this way begin with an empty history, cache, and cookie store, so this block is typically used to clear cookies created during the test run.

Fully expanded, the Clear Web Cookie block shows the following properties:

image-20260108-122602.png

Note: The screenshot on this page uses the Elegance Design, introduced in 2025.3. If you are using an earlier version, your layout may look different.

Quick-start

  1. Drag Clear Web Cookie onto the canvas.

  2. Connect the block in the flow, select a Mode and, if you are clearing a named cookie, set Cookie name. Optionally specify Browser window if you need a particular browser instance.

  3. Run the flow when it’s ready.

Building block parameters

Parameters
  • Block header: Shows the current name of the Clear Web Cookie block. You can rename it at any time by double-clicking the header and typing a new title, which helps keep flows readable and organized.

  • Mode: Determines which cookies will be cleared. You can choose one of the following options:

    • Named cookie: clears a single cookie with the name specified in Cookie name.

    • All cookies (when available): clears all cookies in the current browser window.
      The selected mode must match how you intend to clean up the browser session.

  • Cookie name: Specifies the name of the cookie to remove. This parameter is required when Mode is set to Named cookie and is ignored when clearing all cookies. Use the exact cookie name as it appears in the browser for the deletion to succeed.

  • Browser window: Defines which browser window the block should operate on. If you leave this unset, the block uses the default browser window from the flow. In environments such as Selenium Grid or cloud providers like Sauce Labs and BrowserStack, multiple browser windows are not supported, so this value is typically the single window opened by Start Web Browser.

Resources

Topic

Description

Flows FAQ

Common questions about creating, running, and managing flows in Leapwork.

Flows Troubleshooting

Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.