Multiple accounts with form-based authentication

The first part of this section goes through the steps of the Post-recording wizard and describes the elements related to form-based authentication. In most situations the wizard does the whole job on its own and you just have to confirm what the wizard has detected and decided. The second part of this section details the configuration elements the wizard has created and the information you will need to provide.

The first two steps of the Post-recording wizard are put aside to concentrate on step 3. This is where form-based authentication information is used and can be configured through the wizard.

  1. The Post-recording Wizard step 3 is the form-based authentication.

    For example, you check the accountBean form as being used for authentication. This basically tells the wizard to look for HTTP authentication related parameters in the associated HTTP request.

  2. Define the login field: The wizard automatically detects and identifies the username HTTP parameter as the login field for the form-based authentication.
  3. Define the password field: The wizard automatically detects and identifies the password HTTP parameter as the password field for the form-based authentication.
  4. Define multiple accounts: At this stage the wizard needs to determine whether you want to use multiple accounts to login. You select the Use multiple accounts option accordingly.
  5. Select a CSV file based variable: The wizard now wants to determine if account information (login and password) should be read from a CSV file, or be entered explicitly in the project configuration. You choose the Use the accounts from a CSV file option.
  6. Define the CSV file-type variable:
  7. The Post-recording wizard Step 4 is the login configuration. In this last step, the wizard prompts you to specify which column to use for the login, which column to use for the password and then recaps the created configuration. Here, it has created an "Accounts" variable that has been assigned to the login and password HTTP parameters. The "Accounts" variable has two columns: the first column, ${Accounts.login}, must contain login values; the second, ${Accounts.password}, must contain password values.

The Post-recording wizard has also configured the HTTP request doing the authentication.

The username parameter is associated with the ${Accounts.login} expression and the password parameter associated with the ${Accounts.password} expression. The "Accounts" variable is automatically created and configured by the Post-recording wizard. The ${Accounts.login} value will be read from a CSV file and is expected to contain a login value. The ${Accounts.password} value will be read from the same CSV file and is expected to contain a password value.