Working with properties(SOAPUI)

 
Properties are a central aspect of more advanced testing with soapUI (a general overview of property-management is available at). In regard to Functional Testing properties are used to parameterize the execution and functionality of your tests.
 
Some scenarios where properties can be used and customized are as follows.

  • Properties can be used to hold the endpoints of your services, making it easy to change the actual endpoints used during test.
  • Properties can be used to hold authentication credentials, making it easy to manage these in a central place or external file.
  • Properties can be used to transfer and share session ids during test execution, so multiple teststeps or testcases can share the same sessions.

In this tutorial, let’s see some of the basics about properties involved at all levels like project, testsuite, testcase, test requests level in SOAPUI.
 
DEFINE PROPERTIES:
 
Properties can be defined at various levels in SOAPUI as follows:

  • At the Project, TestSuite and TestCase level in the corresponding Properties tab
  • In a Properties TestStep

 
Let’€™s see how these properties are defined at various levels in the tutorial below.
 

At the Project, TestSuite and TestCase:

 
Project level:
 
Step 1: To view the properties defined at testsuite level, click on testsuite name as shown in the image below.
 
Project Level Properties
 
Step 2: As shown in the image, properties can be added in the project level by clicking on the Property icon icon available in the properties pane and the overview tab shown in the above image.
 
Add Project level properties
 
Step 3: In the Add Property window, enter a property name and click OK.
 
Property name
 
Step 4: Now enter a value for this property added and thus property is successfully added to the project as shown below.
 
Project level property added

 

TestSuite Level:
 
Step 1: To view the properties defined at project level, click on Project name as shown in the image below.
 
TestSuite level property
 
Step 2: As shown in the image, properties can be added in the testsuite level by clicking on the Property icon icon available in the properties pane and the overview tab shown in the above image.
 
add property to testsuite
 
Step 3: In the Add Property window, enter a property name and click OK.
 
Property name
 
Step 4: Now enter a value for this property added and thus property is successfully added to the project as shown below.
 
Testsuite property added

 

TestCase:
 
Follow the same steps discussed for adding properties in testsuites and project to add properties at testcase level as shown in the image below.
 
Testcase property added
 

[box]
Note:

  • Properties added at project level can be used anywhere in that project.
  • Properties added at testsuite level and testcase level can be used within their respective child components.
    • For eg: A property created in a testsuite level can be used within that testsuite and not in any other testsuites in that project.

[/box]
 

In a Properties TestStep

 
The Properties step is used for defining custom properties to be used within a TestCase.
 
Its main advantages over defining properties at the TestCase level or any other levels are:

  • You can organize properties into multiple Properties TestSteps (if you have many of them)
  • You can specify source and target filenames which will be used to read and write the contained properties when the TestStep is executed.

We can define properties at TestStep level using the steps discussed below.
 
Step 1: Right click on TestSteps inside a testsuite and add step –>  Properties as shown in the image.
 
Request level property add
 
Step 2: In the Add Step window, specify the name for the Properties step added and Click OK.
 
Property name_2
 
Step 3: Click on the Property icon icon available in the properties editor window to add a new property.
 
Step 4: In the Add Property window, enter a property name and click OK.
 
Teststep property name
 
Now properties are added successfully to the Properties TestStep as shown in the image below.

 

Teststep property added

 

Learn more about importing and exporting properties, property transfer, etc.,  in other tutorials.