Forum Discussion

M_McDonald's avatar
M_McDonald
Super Contributor
14 years ago

Set Grid load strategy config from script

Is there a way to configure a Grid load test from a script rather than by hand from the UI? I've tried the following from the load test setup script:

loadTestRunner.loadTest.loadStrategy.updateConfig(gridConfig)


and gridConfig is an XmlObject that looks like this:

<xml-fragment>
<duration>0</duration>
<times><![CDATA[<xml-fragment>
<con:entry xmlns:con='http://eviware.com/soapui/config'>1</con:entry>
<con:entry xmlns:con='http://eviware.com/soapui/config'>2</con:entry>
<con:entry xmlns:con='http://eviware.com/soapui/config'>3</con:entry>
</xml-fragment>]]></times>
<threads><![CDATA[<xml-fragment>
<con:entry xmlns:con='http://eviware.com/soapui/config'>1</con:entry>
<con:entry xmlns:con='http://eviware.com/soapui/config'>2</con:entry>
<con:entry xmlns:con='http://eviware.com/soapui/config'>3</con:entry></xml-fragment>]]></threads>
</xml-fragment>


but there is no effect.

Thanks.
  • Hi,

    unfortunately there isn't - do you want us to add such an API call ?

    regards,

    /Ole
    SmartBear Software
  • Hi Mike,

    ok - the upcoming nightly has a

    public void setTimings( String[] times, String[] threads )

    call that requires you to specify two string arrays, one for each column. The reason these are strings is that they support property expansions.

    Let us know if you have any issues!

    regards,

    /Ole
    SmartBear Software
  • M_McDonald's avatar
    M_McDonald
    Super Contributor
    Thanks for the quick turn-around, but I'm a little confused. I set the timings in the load test Setup script, but the grid strategy UI shows something else (please see attached screenshot.)

    I'm really looking for a way be able to reliably specify "run ten times with 1 thread, then 10 times with 2 threads (20 runs), etc."