Forum Discussion

kishore530's avatar
kishore530
Occasional Contributor
7 years ago

using groovy script submit (test) soap request which is in another project in soapui

Hello friends,   Need groovy script (in test_suiteA)to execute(submit) a soap request which is in another test suite(test_suiteB) in soapui. could you please help with the groovy script?
  • Lucian's avatar
    7 years ago

    Hi,

     

    The groovy script for this is quite simple:

     

    // Identify test step
    def testCase = testRunner.testCase.testSuite.project.testSuites["Name of your test suite"].testCases["Name of your test case"]
    def testStep = testCase.testSteps["Name of your SOAP request"]
    
    // Run test step
    testStep.run( testRunner, context ) 
  • kishore530's avatar
    kishore530
    7 years ago

    Thanks a ton Lucian for your help.  Its working :-)

    Could you please help here again.
    is there any possibility to send input value for SOAP request from groovy script ?

     

    I am using below code snippet. but, facing errors.

    testStep.run( testRunner, context.x="5")      // i would need to send value 5 to soap request

     

    in soap request, using like this to ${x} in the request message.