Professional Documents
Culture Documents
Table of Contents
Table of Contents........................................................2 1 Introduction.............................................................3 2 How to create a Test Suite?..........................................4 3 How to add requests in a test suite?.................................7 4 Modify Pass/Fail reporting option in a Test Case?................11 5 Set the Aut credentials ..............................................13 6 Set end point URL for requests.....................................17 7 Running TestRequests and TestCase...............................20 8 Assertions:.............................................................23
1 Introduction
SoapUI structures functional tests into three levels; TestSuites, TestCases and TestSteps. 1. A TestSuite is a collection of TestCases that can be used for grouping functional tests into logical units. Any number of TestSuites can be created inside a soapUI project to support massive testing scenarios. 2. A TestCase is a collection of TestSteps that are assembled to test some specific aspect of your service(s). You can add any number of TestCases to a containing TestSuite and even modularize them to call each other for complex testing scenarios. 3. TestSteps are the "building blocks" of functional tests in soapUI. They are added to a TestCase and used control the flow of execution and validate the functionality of the service(s) to be tested.
Lets look at these in a little more detail: TestSuites (as mentioned above) are created at the project level for grouping TestCases into logical units. For example we can have one TestSuite with account-related TestCases and another for TestCases related to payments. Our project can contain any number of TestSuites and we can see and execute them all (in sequence or parallel) from the Project TestSuites tab. This has been explained in detail in this document.
2.1.1
2.1.2
Provide Project Name and WSDL path (file system path). And press OK.
2.1.3
2.2.2
2.2.3
3.1.2
Provide a name to the new TestCase and press OK, as shown below:
3.1.3
A new TestCase has been created inside out TestSuite, as shown below;
3.2
3.1.2
Specify the name for the request XML, and press OK, as shown below; 8
3.1.3
Then Select the operation that the request will invoke, as shown below;
3.1.4
3.1.5
3.1.6
10
4.1
Right click on the TestCase inside the TestSuite, and select Options, as shown below;
11
4.2
Uncheck the checkbox Abort on error and check the checkbox Fail TestCase on Error, and press OK.
After making these changes, a TestCase will be shown as failed if even a single step inside the TestCase fails. And the execution of the TestCase will not stop when a TestStep fails.
12
5.1.2
13
5.2 Set the Aut credentials (Username and password) for all the requests in a TestCase.
5.2.1 Double click on the TestCase that you created. The following screen will appear;
5.2.2
Select the Key present on the title bar, as shown in the image below;
14
5.2.3
5.2.4
Provide Username and Password and press OK. This will set the same username and password for all requests present in this particular TestCase.
15
16
6.1.2
On the address bar, select option Edit Current and provide the desired end point url, and press OK;
17
6.2 Same end-point URL for all the requests in a TestCase: 6.2.1
Double click on the TestCase that you created. The following screen will appear;
6.2.2
18
6.2.3
Set the end-point URL and press OK. This will set the same end-point URL for all the requests present in the TestCase.
19
20
7.2
7.2.2
The following screen will appear. Uncheck option Abort on Error. And press OK.
21
7.2.3
Double click on the TestCase that needs to be run. Screen similar to the following will appear;
7.2.4
Select the green arrow, present on the tool bar. This will run all the test cases present in the TestCase.
7.2.5
After all TestRequests inside a TestCase have been executed, the following screen will appear;
22
8 Assertions:
Now that we've created our test, we are going to add a validation of the response. In soapUI, this is called adding an assertion. soapUI contains several functions that enhances automation for those who spends their days (and nights) testing and are in need of extensive assertions. Examples of assertions that are possible in soapUI are: Schema Compliance Simple Contains Simple Not Contains SOAP Fault Not SOAP Fault SOAP Response Response SLA XPath Match XQuery Match Script Assertion WS-Security Status WS-Addressing Response Assertion WS-Addressing Request Assertion
8.1
23
8.1.2
8.1.3
Select the operation from the dropdown and press OK, as shown below;
8.1.4
The following four assertion options are provided at this stage. Whatever option is application in your case, select those and press OK.
24
8.1.5
A new blank XML has been created with the assertions applied, as shown in the image below;
25
8.2.2
In the request editor, Click the Add an Assertion to Test Request button.
8.2.3
From the dropdown select the assertion that has to be implemented. Example - Select Response SLA from the drop down in the Select Assertion dialog box.
8.2.4
In the Configure Response SLA Assertion dialog box, write 500 and click OK. This will validate that the response of the SLA is under 500.
26
8.2.5
Now that weve added the assertion, we are going to run the request to validate the response. If all assertions are successful, the SOAP icon will turn green in three places as shown below.
8.3
How to find how many assertions have been applied to a request XML? 8.3.1
The number of assertions that have been applied on the Response can be verified from the Assertion tab. As shown below there are 3 assertions applied on this response.
27
28