lecture 3 of 160 completed

Managing the browser session

Starting and quitting a browser per test is your job in Selenium. Doing it wrong leaks browsers and blocks the machine.

What you'll learn

  • Why a failed test can leave a browser running
  • Where to put start and quit so they always run
  • How to reuse a browser without leaking state

In Selenium you create the browser yourself. That means you also have to close it, and this is where real damage happens.

Look at this test:

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →