Verify Missing "Username and Password" Blocks Login to API

Status : failed

Start Time : 15-12-2024 08:45:11

End Time : 15-12-2024 08:45:13

Duration : 1.50 seconds

Title : Verify Missing "Username and Password" Blocks Login to API

Created By : arun-ramanan@netspective.in

Created At : 2024-12-15

Priority : High

Description

This test case verifies that the API does not allow login when "username" and "password" fields are missing in the request payload.

Pre-Conditions:

  • The API is accessible.
  • The testing environment is set up.
  • The API endpoint for login is known.

Test Steps:

  1. Step 1: Send a POST request to the API login endpoint without including the "username" and "password" fields in the request body.
    • Example Request Body:
      {
        "username": "",
        "password": ""
      }
      
  2. Step 2: Observe the response from the API after submitting the request.

Expected Result:

  • The API should respond with a 400 Bad Request or 401 Unauthorized error, indicating that both "username" and "password" are required.
  • The response should contain a meaningful error message, such as:
    "Error: Missing 'username' and 'password' fields. Please provide valid credentials."

Actual Result

Observe the response from the API after submitting the request. failed 15-12-2024 08:45:13 15-12-2024 08:45:13
Send a POST request to the API login endpoint without including the credentials in fields of the request body. passed 15-12-2024 08:45:11 15-12-2024 08:45:13