Case Study: User Login Tests in Selenium WebDriver

A super simple automated test case that some might still get wrong.

Zhimin Zhan

--

A repost of my daughter’s article with permission. I added a few notes. This is also included in my “How to in Selenium WebDriver” series.

Testing user login is usually the first testing task for an app. This article will go through typical user login test cases in Selenium WebDriver and highlight a common pitfall in automated testing.

Example site: Agile Travel (https://travel.agileway.net/login).

AgileTravel login page
Table of Contents: 
Test Design
Test Case 1: Login OK
Test Case 2: Login Failed
Oops! Failed when Running the Whole Test Script
Analyse and Fix it
Review by Zhimin

Test Design

For login tests, there are usually at least two test cases.

  1. One happy 😊 case: Login successfully
  2. One alternative 😞 case: Login failed from bad credentials

Test Case 1: Login OK

--

--