Site icon Tutorial

Web Forms Authentication

Web Forms Authentication

 

Let’s start by learning Web Forms Authentication. Some web services require form based authentication. In order to be able to use API calls, you typically need to launch a browser, log into a web form, and then establish a session.

Example:

A form that asks for authentication credentials might look like this

<form method=”post” action=”/login”>

Username: <input type=”text” name=”username” required>

Password: <input type=”password” name=”password” required>

<input type=”submit” value=”Login”>

</form>

 

This would render a HTML form:

SoapUI Test Case

The way to deal with this in SoapUI would be to:

Creating HTTP Test Request

In your TestCase, create an HTTP Request Step.

Username is “admin”, and the password “p@ssw0rd” in this case. The HTTP method is specified as POST.

Maintaining Session

When you have a HTTP Request TestStep that works, you can set the TestCase to maintain the session provided by the TestStep.

 

You should now be able to add SOAP and/or REST test steps further in the test case that will maintain the authenticated session.

Make your resume stand out and become a Certified SoapUI Testing Professional. Try free practice tests here!

A great career is just a certification away. So, practice and validate your skills to become a Certified SoapUI Testing Professional.

Go back to Tutorial

Exit mobile version