Previous Topic: Web-Web Services StepsNext Topic: REST Step


HTTP-HTML Request Step

This step is used while testing a traditional web application to send and receive HTTP(S) requests. Requests can include GET parameters and POST parameters and optionally, embedded images as a response. You can also record the HTTP steps using the Website Proxy Recorder.

The HTTP/HTML Request step has a default name using this convention: HTTP(s) ("GET" or "POST") (leaf of URL). An example is HTTP GET rejectCard.jsp. You can change step names at any time.

You can manually execute the HTTP/HTML step at design time (similar to the WS step). When you select Actions, Replay through here, DevTest saves the step responses so the step editors can display the response values.

When you add this step to a test case, the step editor includes the following tabs:

URL Transaction Info Tab

Specify the information that is used to construct the URL on the URL Transaction Info tab.

You can set up the URL transaction information with either of the following options:

 

Specify URL in parts

Select the Specify URL in parts option (default) to specify the URL in its essential pieces.

Protocol

The protocol that is used to communicate with the web server. The default is http.

Host Name

The host name of the web server. Use the property SERVER or enter hostname or IP address of your application server. The host name can be a domain name, such as www.mycompany.com or an IP address, such as 123.4.5.6. For a local web server, use the host name localhost or the IP address 127.0.0.1.

Port

(Optional) If necessary, use the PORT property or the port on the web server that is used to access the web server. For example, the port that is required to access the Apache Tomcat web server by default is 8080.

Path

The path to the file to access. For example, if the URL to access is http://localhost:8080/mysite/index.jsp, enter mysite/index.jsp in the Path field.

User

Enter if a user ID is required for the application server.

Password

Enter if a password is required for the application server.

Encoding
The property governs the Encoding drop-down: lisa.supported.html.request.encodings=ISO-8859-1, UTF-8, Shift_JIS, EUC-JP, Windows-31J

You can change the comma-separated list to include the encodings to support. The underlying JVM must also support all encodings in this list. If a web page uses an encoding that is not supported in the list, then the drop-down entry is blank. If you save in that situation, DevTest replaces the encoding with the DevTest default (file.encoding key in lisa.properties). Also, if you do not select an encoding when creating a HTTP/HTML Request step, then the DevTest default encoding is assumed.

URL Parameters

GET (or URL) Request Parameters: these request parameters are passed as part of the URL, and so they are exposed to the user in address bar of the web browser.

POST Parameters

POST Request Parameters. The request parameters are passed as part of the body of the page request. They are not exposed to the user in the address bar of the web browser.

Form Encoding

During a step execution, parameters are URL encoded as they are sent. The MIME type that is used is application/form-urlencoded.

All Known State

All known properties, such as test case properties, data sets, and filters, are listed.

Download images referenced (test bandwidth)

If this element is selected, the step downloads web page images into the test environment. If you do not select this check box, no images are downloaded.

The following table describes other functions that are part of the toolbar that is available on the URL Parameters and POST Parameters sections.

Field

Icon

Description

Add

LISA-- icon_image_whiteplussign

Add a request parameter

Up

icon_image_whiteuparrow

Move an existing parameter up in the list of parameters

Down

LISA--icon_image_whitedownarrow

Move an existing parameter down in the list of parameters

Delete

con_image_whitetrashcanbluebackground

Delete an existing parameter

Find

 

Find text

Auto-Generate a Filter

LISA--icon_image_threebluearrows

From the referring step to make this parameter dynamic. Create a new filter to auto-populate this property at run time. For more information on filters, see the Filters section.

Apply selected All Known State property

Icon - blue page with arrow to white page

Apply state to the parameter. For more information on applying state, see the All Known State section that follows.

Auto Apply all Known State properties

icon_image_whitesidewaysorgchart

Apply all state to all properties possible by patterns. For more information on applying state, see the All Known State section that follows.

 

All Known State

All known properties, such as test case properties, data sets, and filters, are displayed in the All Known State panel.

All Known State panel

You can assign the values of properties to URL request parameters.

For example, to assign the value of the LISA_USER data set key to the u_login request parameter in the previous example:

  1. Select the u_login key in the URL Parameters pane.
  2. Select the LISA_USER key in the All Known State panel.
  3. Click Apply selected All Known State property to current parameter Icon - blue page with arrow to white page.

    A warning message opens asking you to confirm the impending change.

  4. Click OK.

    The new property is displayed in the URL Parameters pane.

    If all the names of the URL Parameter keys equal the names of the All Known State keys, you can click Apply to All to assign all the properties to the associated parameters quickly.

 

Use Property Option

If the Use property option button is selected, you can specify the following parameters:

Property Key

Specify a property that contains the connection information.

Download images referenced (test bandwidth)

If this element is selected, the step downloads web page images into the test environment. If you do not select this check box, no images are downloaded.

HTTP Headers Tab

On the HTTP Headers tab, create any custom HTTP headers.

To create a request parameter in either section, click Add LISA-- icon_image_whiteplussign and change the key and value to the target values.

Response Tab

On the Response tab, view the HTTP response that the server returns when this test was recorded. You can view:

SSL Tab

The SSL tab lets you enter information for either single or multiple SSL certificates.

 

Using a Single SSL Certificate

Enter the following information:

SSL Keystore File

The name of the keystore file where the client identity certificate is stored. The file can be in JKS or PKCS format.

SSL Keystore password

Password for the keystore file.

SSL Key alias

The keystore attribute that defines the alias that is used to store and retrieve the private key for the server.

SSL Key password

An optional password for the key entry if using a JKS keystore, and key has a different password from keystore.

 

Using Multiple SSL Certificates

To use multiple certificates on one step, store your SSL information in a data set. The following example shows how you can use a data sheet to store information about multiple certificates.

In this example, the demo server is running in the background and it has been configured to require client-side authentication. The demo server accepts five certificates. The keystore files for those certificates are in the project structure in a Data with the name certificates. These keystore files are pkcs12 keystores.

The Demo Server accepts five certificates, and the keystore files for those certificates have been put into the project structure in a Data folder named "certificates."

Next, an HTTPS Request step is added and https is specified as the protocol and the port and path are entered.

HTTPS Request step is added and https is specified as the protocol and the port and path are entered

To ensure this process works with all the certificates and only run the test once, a data set is created for this test step. Use the Create your own Data Sheet data set to create the data set. The data set has the name Certificate Information and it is configured to run through the data set rows once, and then exit. Each certificate has five certificates and four parameters. When all the information is complete, use the Create Data Sheet Skeleton button to open the editor.

Create Data Sheet editor

For keystoreFile, we use the short file name of the keystore so that relative paths can be used later. To encrypt the password columns, right-click the column label and select Encrypt.

Create Data Sheet editor certificate information

Return to the HTTP step and select the SSL tab. Use property substitution for the variables. For the password fields, enter {{keystorePassword}} and {{keyPassword}}.

HTTP/HTML Request step - SSL tab

The test is staged with Stage a Quick Test, and you can see that all of the tests completed successfully. All five certificates were tested against the demo server and client authentication was successful for all of them.

Test staged with Quick Stage Test