Forum Discussion

Keacey's avatar
Keacey
Contributor
18 years ago

Test step Type

Hi,

How can i get the Test Step Type (like test request, groovy step, property transfer etc) for any test step? i want to use this information in groovy script.

Also how do u use the below method in a TestCase Interface? Could you please give me an example with respect to Test Request type?

java.util.List getTestStepsOfType(java.lang.Class stepType)

Thanks in advance.
KC.

10 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    you can use

    testStep.config.type

    to get the type of a testStep. You can use the getTestStepsOfType method with for example:

    def requests = testCase.getTestStepsOfType( WsdlTestRequestStep.class )

    to get all requests..

    regards!

    /Ole
    eviware.com
  • Hi,

    I tried with

    def requests = testCase.getTestStepsOfType( WsdlTestRequestStep.class )

    but this did not work and was giving errors.
    However i used

    testStep.config.type


    for my code and it gave me perfect results. 

    Thanks a lot Ole.

    Regards,
    KC.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    hmm.. what errors did you get with this first statement?

    regards,

    /Ole
    eviware.com
  • Hi Ole,

    This is the error i got.

    org.codehaus.groovy.runtime.metaclass.MissingPropertyExceptionNoStack: No such property: WsdlTestRequestStep for class: Script27

    i did not replace "WsdlTestRequestStep" in the code with anything else. Was this the problem?

    KC.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi!

    you will either need to import the WsdlTestRequestStep class or use

    def requests = testCase.getTestStepsOfType( com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.class )

    regards,

    /Ole
    eviware.com
  • what is the problem you facing ... do you see any exceptions while you start ?
  • This post helped me for checking step type run time.

    But after than i tried to find other items which I can get from teststep.config, but I was not able to find details easily.

    So could you please send me the details that how can I get all information about teststep.config.

    Thanks,
    Akhilkumar Patel - Test Automation Architecture
  • The easy way for knowing teststep type using groovy script is:

    testStep.config.type.

    Some of the possible types are:
    1. datagen
    2. datasource
    3. restrequest
    4. datasourceloop
    etc.