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.
- To set multiple accounts with form-based authentication
- 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.
- Define the login field: The wizard automatically detects and identifies the username HTTP parameter as the login field for the form-based authentication.
- Define the password field: The wizard automatically detects and identifies the password HTTP parameter as the password field for the form-based authentication.
- 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.
- 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.
- Define the CSV file-type variable:
- To be able to replace the recorded parameters with dynamic values, you need to define the file-type variable that will be used. This step in the wizard allows you to select the variable parameters. Select the CSV file to use by clicking on the picker button. The first few values are displayed to check the file content.
- Double-click on the column headers to change the names to more meaningful names: Accounts.login and Accounts.password.
- The Value change policy selected by the wizard is for "Each Virtual User". This is consistent with the behavior you are looking to create, since we may want a new value to be used each time a Virtual User connects to the application.
- 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.
Home