author | Oleksandr Gavenko <gavenkoa@gmail.com> |
Mon, 26 Oct 2020 12:51:23 +0200 | |
changeset 2441 | 58d60b3e470a |
parent 2250 | c713fb5d5c31 |
permissions | -rw-r--r-- |
2249
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
1 |
.. -*- coding: utf-8; -*- |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
2 |
|
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
3 |
======== |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
4 |
SoapUI |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
5 |
======== |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
6 |
.. contents:: |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
7 |
:local: |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
8 |
|
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
9 |
Property syntax |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
10 |
=============== |
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
11 |
|
2250
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
12 |
Injecting property:: |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
13 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
14 |
${#Project#NAME} |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
15 |
${#TestSuite#NAME} |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
16 |
${#TestCase#NAME} |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
17 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
18 |
Injecting Groovy script result:: |
2249
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
19 |
|
2250
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
20 |
${=(int)(Math.random()*1000)} |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
21 |
${=new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(new Date())} |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
22 |
${=import static java.util.UUID.randomUUID; randomUUID() as String} |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
23 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
24 |
https://www.soapui.org/scripting-properties/property-expansion.html |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
25 |
Property Expansion. |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
26 |
https://www.soapui.org/docs/functional-testing/properties/transferring-properties.html |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
27 |
Transferring Property Values. |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
28 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
29 |
Working with properties from Groovy |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
30 |
=================================== |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
31 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
32 |
Accessing properties:: |
2249
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
33 |
|
2250
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
34 |
testRunner.testCase.getPropertyValue("NAME") |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
35 |
testRunner.testCase.testSuite.getPropertyValue("NAME") |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
36 |
testRunner.testCase.testSuite.project.getPropertyValue("NAME") |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
37 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
38 |
Setting properties:: |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
39 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
40 |
testRunner.testCase.setPropertyValue("NAME", "VAL"); |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
41 |
testRunner.testCase.testSuite.setPropertyValue("NAME", "VAL"); |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
42 |
testRunner.testCase.testSuite.project.setPropertyValue("NAME", "VAL"); |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
43 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
44 |
Working with global properties:: |
2249
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
45 |
|
2250
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
46 |
com.eviware.soapui.SoapUI.globalProperties.getPropertyValue("NAME") |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
47 |
com.eviware.soapui.SoapUI.globalProperties.setPropertyValue("NAME", "VAL") |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
48 |
com.eviware.soapui.SoapUI.globalProperties.getProperty("NAME").setValue("VAL") |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
49 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
50 |
There is ``removeProperty`` method for removing properties. |
2249
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
51 |
|
2250
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
52 |
To expand property syntax:: |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
53 |
|
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
54 |
context.expand( '${#Project#PROP}' ) |
2249
efe2882b5554
Assigning property from Groovy.
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
diff
changeset
|
55 |
|
2250
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
56 |
https://www.soapui.org/docs/functional-testing/properties/working-with-properties.html |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
57 |
Working with Properties. |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
58 |
https://www.soapui.org/scripting-properties/tips-tricks.html |
c713fb5d5c31
Working with properties from Groovy
Oleksandr Gavenko <gavenkoa@gmail.com>
parents:
2249
diff
changeset
|
59 |
Accessing Properties. |