Forum Discussion

Usha_Kodali's avatar
Usha_Kodali
Frequent Contributor
15 years ago

RESOLVED - running teststep of another testcase

How to run particular test step of another test case?
Ex: I have teststep1 in testcase1
I want to run teststep1 in testcase2 . I want to execute in Setup Script.

I know how to run entire testcase...but I want to run only a particular step.

9 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    you should try our upcoming nigtly-build version 3.0 ( http://www.eviware.com/nightly-builds/ )
    And with this new version of SoapUIPro you can try this sample script :


    import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner

    def testcase = testRunner.testCase.testSuite.project.testSuites["test suite name"].getTestCaseByName ("test case name")

    WsdlTestCaseRunner runner = new WsdlTestCaseRunner( testcase,null );

    runner.runTestStepByName("test step")


    I hope this will help.

    Regards,
    Nebojsa

    eviware.com
  • Usha_Kodali's avatar
    Usha_Kodali
    Frequent Contributor
    Thanks for the info...which nightly build will have this?
    I am using July 5th nightly build currently...
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    This will be in nightly-build  July 10th (i.e.  tomorrow )

    //Nebojsa
    eviware.com
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Usha,

    are you still having issues with this or is it working ok now?

    regards!

    /Ole
    eviware.com
  • Usha_Kodali's avatar
    Usha_Kodali
    Frequent Contributor
    Hi Ole,
    I am getting Null pointer exception...the error is
    Mon Aug 03 09:13:13 EDT 2009:ERROR:java.lang.NullPointerException
      java.lang.NullPointerException
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:190)
      at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStepByName(WsdlTestCaseRunner.java:180)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
      at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
      at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
      at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      at Script8.run(Script8.groovy:8)
      at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:59)
      at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:50)
      at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
      at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction.actionPerformed(GroovyScriptStepDesktopPanel.java:268)
      at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
      at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
      at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
      at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
      at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
      at java.awt.Component.processMouseEvent(Unknown Source)
      at javax.swing.JComponent.processMouseEvent(Unknown Source)
      at java.awt.Component.processEvent(Unknown Source)
      at java.awt.Container.processEvent(Unknown Source)
      at java.awt.Component.dispatchEventImpl(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
      at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
      at java.awt.Container.dispatchEventImpl(Unknown Source)
      at java.awt.Window.dispatchEventImpl(Unknown Source)
      at java.awt.Component.dispatchEvent(Unknown Source)
      at java.awt.EventQueue.dispatchEvent(Unknown Source)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
      at java.awt.EventDispatchThread.run(Unknown Source)

    My code:

    import com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner

    def testcase = testRunner.testCase.testSuite.project.testSuites["Trivia"].getTestCaseByName ("GetTriviaTopicTypeByTopicTypeID")

    log.info(testcase.getLabel())

    WsdlTestCaseRunner runner = new WsdlTestCaseRunner( testcase,null );

    runner.runTestStepByName('Logfile')

    Let me know if you need anything else.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Usha,

    Thanks for your input on this.
    this issue is fixed and you can check that in nighly-builds tomorow.

    regards
    Nebojsa
    eviware.com