Spirent Avalanche 5.46 February 29, 2024

Using Forms Databases With Action Lists

To complement Action lists, you can use forms databases to provide values that simulate simultaneous Internet users entering data to access an Internet site. Forms databases allow lists to query values similar to a database, instead of placing all the data in the list.

Forms databases/variables are supported for the following protocols and the data indicated:

Creating Forms Databases

You can create forms databases files by using Avalanche Commander, or you can create them using another application, such as Microsoft Excel. To work with forms databases, use comma-separated value (CSV) format, and use the Forms tab on the Client Actions tab.

For example, you can simulate a test site that allows a user to enter a username and password, and then log in (similar to a client sending a GET request). To support this example, you could create a forms database by using Excel where the first row identifies the column headings, such as username and password, and subsequent rows define the users' names and the passwords, as shown in the following example:

username,password

sidney,letmein

marcus,welcome

felix,entrykey

In this example, you test a valid Internet site and select the Skip First Row option in the Forms tab on the Client Actions tab, when you import the file. The Skip First Row option comments-out the first row column headings, username and password.

TIP: If your forms database contains characters that an Action list cannot accept, use the URL Encode Form option to convert them to an acceptable format before sending the request. The URL Encode option is available in the Forms tab on the Client Actions tab.

Next Row and Auto Increment

If the forms database has multiple rows, you can use the Next Row command to access the next row in the forms database. You can alternatively use the Auto Increment option in the Forms tab on the Client Actions tab to move the cursor to the next row each time the database is accessed. If you use both Auto Increment and Next Row, Avalanche performs both actions. For example, it automatically moves the cursor down a row, and then it moves it down one more row to satisfy the Next Row action. For more information, see Forms Databases and Auto Increment.

Action List Examples

The following provides an example Action list for an HTTP protocol. For other protocol examples, see the links at the beginning of this topic.

The Action list for the forms database example described in the previous section is as follows.

1 GET http://www.somewebsite.com/cgi-bin/?username=<formsdb.$1>&password=<formsdb.$2>

NEXT ROW <formsdb>

The Action list replaces the required usernames and passwords with key name/value pairs from the forms database file.

In this example, the forms database filename is formsdb and the different columns of the forms database are identified as $1 (first column), $2 (second column), and so on. The <formsdb.$1> corresponds to the first column, in this case the username sidney, and the <formsdb.$2> corresponds to the second column, in this case the password letmein. This process allows Avalanche to simulate multiple users logging in simultaneously, each filling out a form with different strings and values. The Action list also includes the command to move the database cursor to the next row of the file.

The processed Action list, coupled with the forms database values, will look like this:

http://www.somewebsite.com/cgi-bin/?username=sidney&password=letmein

GET, HEAD, HTTPDEL, POST, and PUT methods are supported. Only textual POST/PUT methods are supported. Avalanche does not support uploading a binary file. This is because an HTTP upload of a binary from the browser is not as simple as appending strings to the end of the Action in ASCII key/value pairs. It requires the browser to behave almost like a server for the POST/PUT, declaring Content-Length in the initial packet, followed by a packet with Content-Disposition and Content-Type fields, followed by the binary data.

Avalanche simulates a binary file POST/PUT by using a form data file with a long embedded string that matches the expected size of the file. Avalanche supports several form data file formats.

NOTE: See Create Cursor for information about using the Create Cursor action to assign and manipulate forms database references when using HTTP and HTTPS protocols.


Create New Forms Database

Forms Databases and Auto Increment

User-Defined Database Cursors

Using Excel to Create Form Databases

Special Characters

© 2024 Spirent Communications, Inc. All Rights Reserved.