Forum Discussion

CaryB's avatar
CaryB
Contributor
11 years ago

[Res] Toggle Enable/Disable for Custom Step

Ok, I'm stumped.

I'm using the old API (I was already down that path so I'll need to re-write at some point) and I have my test step and actions working how I'd like. However, one of my developers pointed out a glaring omission on my part.

I haven't been able to figure out how to add the Disable Teststep option for my custom step. I've figured out how to add WsdlTestStepSoapUIActionGroup to an actionGroup and get Disable to show up for an out-of-the-box item but I don't have an action mapping for my factory. I guess I was hoping that using the WsdlTestStepFactory would magically handle that sort of stuff.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    I am a little confused as to what you are tryin to do, can you please explain further and also send a full screen shot so that I can see where you are doing the right click from.

    Regards,
    Temil
  • Let me try this again. Individual test steps can have their enabled state toggled. fwiw, Export Xml invokes a custom action to do the same thing only on an individual SOAP request. The Save Tests step will save every request in the test case.



    I have written a custom test step to save the request/response XML. I have all of the functionality I want but I can't figure out how to add the toggling support. I thought the factory framework would manage that for me but I guess I was making a bad assumption. So when I right-click my test step this is what I get.

  • w00t!

    I figured it out without having to manually do anything with the API. I knew there had to be a way. Just took a bit for the gears to click together in my mind.

    Solution
    1. Create my own action group.


    <tns:actionGroup name="My Actions" id="MyCustomStuffActions"
    class="com.eviware.soapui.impl.wsdl.actions.teststep.WsdlTestStepSoapUIActionGroup">
    </tns:actionGroup>


    I figured out that the groups were named by the class they're tied to. So if my class was MyCustomStuff.java I just needed to tack "Actions" to the end of it for my id. Once I did that, WsdlTestStepSoapUIActionGroup worked its magic and implemented the default actions (Open Editor and the enable toggle).

    2. Make sure I have hasEditor set to false in my constructor so I only get the toggle and not the "Open Editor" option as well.

    super(testCase, config, false, forLoadTest);

    This took longer than expected to figure out but I've got what I want.