Forum Discussion
corki
17 years agoContributor
After 1 day googling and working I made this as answear for my own question 
-------------------------------------------------------------------------
def testSuiteName = "my_TestSuite";
def testCaseName = "my_TestCase";
def testStepName = "my_TestRequest_step";
def interfaceName = "FuelPriceSearchSOAP";
def operationName = "GetFuelPrices";
def assertion_xPathName = "my_xPath_Match";
def assertion_ScriptName = "my_ScriptAssertion";
// Create New Test Suite ,... or USE Existing ========================================================
if( testRunner.testCase.testSuite.project.getTestSuiteByName( testSuiteName) == null ) newTestSuite = testRunner.testCase.testSuite.project.addNewTestSuite( testSuiteName );
else newTestSuite = testRunner.testCase.testSuite.project.getTestSuiteByName( testSuiteName );
// Create New Test Case =======================================================================
def newTestCase = newTestSuite.addNewTestCase( testCaseName );
// Create New Test Step ========================================================================
//testRunner.testCase.addTestStep( "properties", "my Dolly TestStep - Properties" );
// def newTestStep = newTestCase.addTestStep( "request", testStepName );
// get operation
def op =testRunner.testCase. testSuite.project.interfaces[interfaceName].operations[operationName];
// create config
def config = com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestRequestStepFactory.createConfig( op, testStepName );
// add to testcase
def newTestStep = newTestCase.addTestStep( config );
// set NEW Request for testStep
newTestStep.setPropertyValue("request", "lala");
// read Request from testStep
def testStepRequest = newTestStep.getPropertyValue("request");
log.info(testStepRequest);

-------------------------------------------------------------------------
def testSuiteName = "my_TestSuite";
def testCaseName = "my_TestCase";
def testStepName = "my_TestRequest_step";
def interfaceName = "FuelPriceSearchSOAP";
def operationName = "GetFuelPrices";
def assertion_xPathName = "my_xPath_Match";
def assertion_ScriptName = "my_ScriptAssertion";
// Create New Test Suite ,... or USE Existing ========================================================
if( testRunner.testCase.testSuite.project.getTestSuiteByName( testSuiteName) == null ) newTestSuite = testRunner.testCase.testSuite.project.addNewTestSuite( testSuiteName );
else newTestSuite = testRunner.testCase.testSuite.project.getTestSuiteByName( testSuiteName );
// Create New Test Case =======================================================================
def newTestCase = newTestSuite.addNewTestCase( testCaseName );
// Create New Test Step ========================================================================
//testRunner.testCase.addTestStep( "properties", "my Dolly TestStep - Properties" );
// def newTestStep = newTestCase.addTestStep( "request", testStepName );
// get operation
def op =testRunner.testCase. testSuite.project.interfaces[interfaceName].operations[operationName];
// create config
def config = com.eviware.soapui.impl.wsdl.teststeps.registry.WsdlTestRequestStepFactory.createConfig( op, testStepName );
// add to testcase
def newTestStep = newTestCase.addTestStep( config );
// set NEW Request for testStep
newTestStep.setPropertyValue("request", "lala");
// read Request from testStep
def testStepRequest = newTestStep.getPropertyValue("request");
log.info(testStepRequest);