Troubleshooting Selenium Authentication Failure in Web Application Scans

Issue Description

Selenium Authentication fails during a Web Application Scan using Qualys Browser Recorder (QBR). The scan does not authenticate successfully, and the script fails to execute as expected.

Possible Causes

  • The credentials used in the Selenium script may have changed or expired.
  • The application uses dynamic field ID, causing the script to fail.
  • The script uses element ID that are no longer valid or consistent across sessions.

Troubleshooting Steps

To fix the above issues, follow the steps below:

  1. Verify credentials.
    • Run the script manually in QBR to confirm that the login credentials are still valid.
  2. Check for dynamic fields.
    • Inspect the login form in the browser to see if field IDs or names change each time the page loads.

      Check Dynamic Fields.

  3. Use Full XPath for dynamic elements.
    • Right-click the input field and click Inspect.

      Inspect.

    • Copy the full XPath (for example, /html/body/div/...) from the browser’s developer tools.
    • In QBR, update the Target field of the affected element with the full XPath.
    • Add an extra forward slash at the beginning (for example, //html/body/...).

      Add extra slash.

  4. Retest the script.
    • Save and test the updated script in QBR.
    • Confirm that all steps pass and the message Test case passed appears in the QBR logs.