With TestDriver, you can automate the testing of cookie banners on your web application. This scenario demonstrates how to check if a cookie banner appears when a user visits the site and how to interact with it.

Prerequisites

Before running the tests, ensure you have performed the following steps:

  1. If you haven’t already, signup for a Free Trial on the TestDriver website
  2. Install the TestDriver CLI globally using npm or just follow the VS Code Extension Setup Walkthrough:
npm install -g @testdriverai@beta
  1. Run the init command to set up the TestDriver configuration using the API key you got when you signed up for the trial:
testdriverai init
Now you are ready to run the tests!

Scenario overview

  1. Visit the Site: The test will navigate to the target URL.
  2. Check for Cookie Banner: It will verify if the cookie banner is displayed.
  3. Decline Cookies: The test will simulate a user clicking the “Decline All” button on the cookie banner.

TestDriver in action