This tutorial describes how to enable HTTP authorization for the following HTTP form:
Username: <input type="text" name="username" required>
Password: <input type="password" name="password" required>
<input type="submit" value="Login">
</form>
Here is what this form may look like in a browser:
To authorize using this form:
-
Create an HTTP Request test step with the appropriate settings (username, password, method).
In this example, the username is
admin
, the password isp@ssw0rd
, and theHTTP method
is specified asPOST
.Make sure the HTTP request endpoint matches the address in the action
attribute of theform
element. -
Open the created HTTP request and select the Post QueryString option.
-
Set the HTTP Request test step to keep the session alive by using the Maintain HTTP Session option.
-
Select the test case in the Navigator.
-
Click on the test case toolbar.
-
Switch to the Basic tab.
-
Select the Maintain HTTP Session option.
-
Click OK.
-
When everything is set up, the session will be maintained, and any other requests in the test will use the authenticated session.
See Also
About HTTP Authorization
HTTP Request Test Step
Authentication