Sunday, July 14, 2019

SoapUI properties

Let us continue with SoapUI testing tutorials. A property in Soap UI tool is a setting of an item. The item can be a SoapUI workspace, a SoapUI project, a SoapUI testsuite, a SoapUI test case, a SoapUI test step or a SoapUI request. The property holds a text value. You can use properties in SoapUI to specify your item. This way, the existing item can work with the settings that you specify. View my SoapUI beginner tutorial on SoapUI properties to see many examples or read on...

The Properties pane is located at the bottom left in SoapUI. The Properties window shows the properties of the currently selected item in the project tree. It has two tabs - Item Properties and Custom Properties e.g. Project Properties and Custom Properties. The Item Properties tab shows the built-in properties and their values. You can click in the Value textbox of a property and set or change its' value. The Custom Properties tab shows the properties defined by you and their values. You can add or remove properties in the Custom Properties tab.

Properties in SoapUI have scope, depending on where a property is defined e.g. project level, test suite level or test case level. The advantage of properties in Soap UI is that if you set the property value in one item, then that value is used everywhere within that scope. For example, if you set a property value of the test case, that value is used in all the test steps within that test case. SoapUI global properties have full scope. They are available in Preferences > Global Properties tab.

There are three property editors in SoapUI, where you can add or remove properties or set or change any property value:
  1. Properties window (in Custom Properties tab)
  2. Inspector window (Properties tab)
  3. Navigator window - Click the Toggle button in the Navigator. Right-click on Properties to add another property. Double-click the property to set its value.
A Groovy script can read or write properties in SoapUI using getPropertyValue and setPropertyValue functions e.g.
def Name = testRunner.testCase.testSuite.getPropertyValue( "SampleProperty" )
testRunner.testCase.testSteps["NumberToDollars"].setPropertyValue( "Username", "TestUser" )

Want to learn more? You can learn all the above and see example of SoapUI Property Transfer and Groovy Script run in my Soap UI Properties tutorial. Thank you.

No comments:

Post a Comment