At runtime, if the web server or web proxy requires NTLM or Basic Authentication, then this authentication is automatically handled, providing data dictionary values are set for the data items user and password.
There are several methods by which user and password values can be assigned, as explained below:
Unique Values for Every Virtual User
Create a data table with columns names user and password.
Create a row for each virtual user (VU) containing the values as shown in the following example:
Assign this data source to any VU Groups running scripts that require authentication.
Single User and Password for All Users in a Group
Set values for user and password in the Global variables section of the Data tab for the test.
In a Data Dictionary file assigned to multiple VU Groups.
Create data similar to the following:
user = mytestuser
password = yuiyui5ui45ui
Insert Code in the Script
this.getWebBrowser().setUserPassword(getString("user", "myuser"), getString("password", "mypassword"));
this.WebBrowser.SetUserPassword(GetString("user", "myuser"), GetString("password", "mypassword"));
The more complex Java and C# code examples extract values for user and password from the VU data dictionary, and use the default values "myuser" and "mypassword" if the data dictionary doesn't include these values.
This code is automatically inserted in the script by the web script generator if the Server or proxy Authentication Required checkbox is selected on the Authentication tab of the Web Generation Options dialog box for a web script.