soapui.rst
author Oleksandr Gavenko <gavenkoa@gmail.com>
Sun, 03 Jan 2021 23:37:00 +0200
changeset 2492 bd3d45148652
parent 2250 c713fb5d5c31
permissions -rw-r--r--
Fixed example.

.. -*- coding: utf-8; -*-

========
 SoapUI
========
.. contents::
   :local:

Property syntax
===============

Injecting property::

  ${#Project#NAME}
  ${#TestSuite#NAME}
  ${#TestCase#NAME}

Injecting Groovy script result::

  ${=(int)(Math.random()*1000)}
  ${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())}
  ${=import static java.util.UUID.randomUUID; randomUUID() as String}

https://www.soapui.org/scripting-properties/property-expansion.html
  Property Expansion.
https://www.soapui.org/docs/functional-testing/properties/transferring-properties.html
  Transferring Property Values.

Working with properties from Groovy
===================================

Accessing properties::

  testRunner.testCase.getPropertyValue("NAME")
  testRunner.testCase.testSuite.getPropertyValue("NAME")
  testRunner.testCase.testSuite.project.getPropertyValue("NAME")

Setting properties::

  testRunner.testCase.setPropertyValue("NAME", "VAL");
  testRunner.testCase.testSuite.setPropertyValue("NAME", "VAL");
  testRunner.testCase.testSuite.project.setPropertyValue("NAME", "VAL");

Working with global properties::

  com.eviware.soapui.SoapUI.globalProperties.getPropertyValue("NAME")
  com.eviware.soapui.SoapUI.globalProperties.setPropertyValue("NAME", "VAL")
  com.eviware.soapui.SoapUI.globalProperties.getProperty("NAME").setValue("VAL")

There is ``removeProperty`` method for removing properties.

To expand property syntax::

  context.expand( '${#Project#PROP}' )

https://www.soapui.org/docs/functional-testing/properties/working-with-properties.html
  Working with Properties.
https://www.soapui.org/scripting-properties/tips-tricks.html
  Accessing Properties.