Udemy

How to handle Properties with Groovy Scripts

Raghav Pal的免費影片教程
Automation Test Architect | Educator | 15 yrs
評等︰4.5/5講師評等
35 門課程
452445 位學生
How to handle Properties with Groovy Scripts

講座說明

Today we will learn:

1. How to get property

2. How to set property

3. How to add property

4. How to remove property

5. How to loop through all properties

References

https://www.soapui.org/scripting-properties/tips-tricks.html

Notes

// Get and Set Property

//Project

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

testRunner.testCase.testSuite.project.setPropertyValue("Name","I am in Project")

//TestSuite

testRunner.testCase.testSuite.getPropertyValue("Name")

testRunner.testCase.testSuite.setPropertyValue("Name","I am in TestSuite")

//TestCase

testRunner.testCase.getPropertyValue("Name")

testRunner.testCase.setPropertyValue("Name","I am in TestCase")

//TestStep

testRunner.testCase.getTestStepByName("CountryCodes").getPropertyValue("Name")

testRunner.testCase.getTestStepByName("CountryCodes").setPropertyValue("Name","I am in Test Step")

//Global

com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "Name")

com.eviware.soapui.SoapUI.globalProperties.setPropertyValue( "Name","I am in Global Prop" )

// Add Property

testRunner.testCase.testSuite.project.addProperty("DOB")

// Remove property

//Project

testRunner.testCase.testSuite.project.removeProperty("Name");

//TestSuite

testRunner.testCase.testSuite.removeProperty("Name")

// Loop through properties

testRunner.testCase.properties.each

{

key,value ->

log.info (testRunner.testCase.getPropertyValue(key))

//log.info (key+" - "+value)

}

學習完整課程,瞭解更多知識

SOAPUI API Testing | Step by Step for Beginners

learn SoapUI from scratch

06:44:07 長的隨選影片 • 更新於 October 2025

Use SoapUI open source for API testing
Create manual and automation frameworks in SoapUI
How to use Groovy scripts
How to handle different api testing needs
Basics of API testing in SoapUI