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?

  • 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 ) 
  • 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.

     

     

  • Lucian's avatar
    Lucian
    Community Hero

    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
      Occasional Contributor

      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.

       

       

  • Lucian's avatar
    Lucian
    Community Hero

    Glad to help.

    Did you solve your latest problem? The one with sending a parameter to the soap request?

     

    BTW, please mark my answer as a solution to your problem if this is the case. :D

    • kishore530's avatar
      kishore530
      Occasional Contributor

      yes Lucian. both my issues are fixed. thanks for the prompt response.