Service Virtualization

  • 1.  How to get count of testExec properties?

    Posted Sep 20, 2018 06:25 AM

    I have a requirement where I need to read a property dynamically. So I need to get the count of properties first like in SOAP UI we have an api testRunner.testCase.getPropertyCount() and then we read the properties in a loop

     

    for (int i =0; i < testRunner.testCase.getPropertyCount(); i++) {

    String propName = testRunner.testCase.getPropertyAt(i).name

     

    Do we have such api's available in DevTest also?



  • 2.  Re: How to get count of testExec properties?

    Broadcom Employee
    Posted Sep 20, 2018 11:38 AM

    Hi Deven,

     

    I'm not sure what you mean by "read a property dynamically".  All properties can be evaluated by placing their name between double curly braces.

     

    However, to answer your question, here are two methods on TestExec you might find useful.

     

    getAllState() - returns a java.util.Map where you can access all of the properties and get the Map size.

     

    getStateProps() - returns a String[] with all property names.

     

    --Mike