Blog

Session Timeout Test Cases

Session Timeout Test Cases

Table of Contents

ABOUT SESSION TIMEOUT

A session can end (or terminate) when the user ends it, explicitly or implicitly. However, if the user does not end the session, the server can end the session if it detects no user interaction within a predetermined amount of time. When the server ends a session in this manner, it is referred to as a session timeout.

SESSION TIMEOUT-TEST CASES

TC ID

FEATURE

TEST CASES/STEPS

EXP RESULT

TS_Session_timeout_1

Session Expiry

Objective: To validate the application behavior when user perform any action/operation in the application after keeping the application in idle less than the token expiry time (Eg:1 Hour)

Steps:
1.Login to the Application with valid credentials on a single browser
2. Leave the session idle for less than defined session time out period
3. Resume the activity on the application in the browser
4. Now observe the application session behaviour

User should not be logged out from the application and allowed to perform any action in the application

TS_Session_timeout_2

Session Expiry

Objective: To validate the application behavior when user perform any action/operation in the application after keeping the application in idle more than the token expiry time

Steps:
1.Login to the Application with valid credentials on a single browser
2. Leave the session idle for equal to or more than defined session time out period
3. Resume the activity on the application in the browser
4. Now observe the application session behaviour

User should be logged out from the application citing the reason that the application session timed out and not allowed to perform any action in the application until logged in again

TS_Session_timeout_3

Session Expiry

Objective: To validate application behavior when user working in a single tab where as application opened in multiple tabs of a browser

Steps :
1. Launch and login to the application in multiple tabs in a Browser (Eg : in 2 tabs)
2. Keep the application idle in app1 and navigate to tab 2 perform any operations
3. Navigate to application in tab 2 After session expiration time
4. Observe the application behavior

User should not logged out from the application in both tab2 and tab1 and allowed to perform any action in the application

TS_Session_timeout_4

Session Expiry

Objective: To Validate the application behavior when user changed the password from profile/Forgot password flow

Steps:
1.Login to the Application with valid credentials on a single browser in the same system and launch the application in multiple tabs of the same browser
2. Leave the session idle for sometime
3. Work on any 1 of the browser tabs inside the application and change the password
4. Now observe the application session behaviour

User has to be logged out from the application in all the browser tabs

TS_Session_timeout_5

Session Expiry

Objective: To validate the application behavior when user is logged in multiple browsers/devices

Steps:
1.Login to the Application with valid credentials on multiple browsers in the same system
2. Leave the session idle for sometime
3. Work on any 1 of the browser tabs inside the application to ensure the session token doesnt timeout
4. After session time out period is completed, observe the application behaviour

User should not be logged out from the application

TS_Session_timeout_6

Session Expiry

Objective: To validate the application behavior when user working in multiple tabs in same browser and logged out from one tab and then performed actions in the other tab

Steps:
1.Login to the Application with valid credentials
2. Leave the session idle for sometime
3. Disconnect the internet
4. After session time out is over, reconnect the internet and work with the application
5.Observe the application behaviour

User should be logged out from the application & has to be taken to login page

TS_Session_timeout_7

Session Expiry

Objective: To validate the application behavior when logged in to the application and disconnected the internet and after session expiration time reconnecting with internet and reloads the application

Steps:
1.Login to the Application with valid credentials
2. Leave the session idle for sometime
3. Disconnect the internet
4. After session time out is over, reconnect the internet and work with the application
5.Observe the application behaviour

User should logged out from the application and allowed to perform any action in the application

TS_Session_timeout_8

Session Expiry

Objective: To validate the application behavior when user logged in to the app in multiple browsers/systems then logged out from one browser/system

Steps:
1.Login to the Application with valid credentials.
2.Next login with same url in another browser/System.
3.Logout from one browser/system.
4.Navigate to another browser/system.
5.Observe the application behaviour.

User A should be logged from Browser 1 and should not be logged out in other browser/system

TS_Session_timeout_9

Session Expiry

Objective: To validate the application behavior when user A is logged in to the application and other side account got locked due to invalid password attempts by same user in other device/browser

Steps:
1.Login to the Application with valid credentials on system1
2.Next login with same url in another system2 with invalid attempts
3. Ensure the login credentials are locked
4.Navigate to another browser/system1
5.Observe the application behaviour

The Application has logout successfully when user perform any action in the application

TS_Session_timeout_10

Session Expiry

Objective: To validate if the application generates a new session id after the session timed out and a new session began

1. On the login window enter the valid credentials and
click on login button.
2. Check the Session ID generated and note it down.
3. Leave the system idle for time more than session time
specified in code (default it is 20 min)
4. After (say 20 min) perform any operation on the
application (click on any link).
5. User should be redirected to the Login page giving msg
as ‘Due to security reasons, session has been expired.
6. Close the browser. Open new browser, enter the URL and
login again.
7. Check the Session ID generated and compare it with the
previous session id

The 2 session ids generated should be different