Parameterize Username and Password Parameters in Selenium Script

1. Record a Selenium script using the Qualys Browser Recorder.  Once you have finished, stop the recording.  We will be manually editing a few fields.

Recorded Selenium script opened in Qualys Browser Record, showing username and password.

2. Click on the row where the username is defined.  In the example below, this is a ‘sendKeys’ command. This will allow you to edit the value of the username below. We will need to change it to @@authusername@@. The parameter name is case insensitive.

The Send key command in the Selenium script selected and the value field shows the username parameter.

3. Do the same for the password field, replacing the actual password with @@authpassword@@. The parameter name is case insensitive.

The Send key command in the Selenium script selected and the value field shows the password parameter.

4. Save the Selenium script, and upload it into your Qualys WAS Authentication Record. After you upload the Selenium script, select the "Add credentials to Selenium Script" check box. You will see the Standard configuration section showing the username and password fields. Enter the username and password in the respective fields. During the scan, we will replace @@authusername@@ and @@authpassword@@ with the username and password that you have provided here.

The Authentication record creation wizard shows the Add credentials to Selenium script check box selected type and values entered in the username and password fields.