lecture 8 of 160 completed

Skipping the login screen

Logging in through the form on every test wastes minutes. Setting the session cookie directly is much faster.

What you'll learn

  • How to skip the login form without weakening coverage
  • Why setting the session directly is faster and steadier
  • Which test must still use the real form

Logging in through the form takes about three seconds. With eighty tests that is four minutes of every run, spent typing the same password.

Selenium has no built-in feature for saving a session, so teams solve it themselves. The usual way is to get the session cookie once, then set it directly in later tests.

Step 1: get the cookie after a real login. Do this once, in a setup step:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →