Forum Discussion

mforgues's avatar
mforgues
Occasional Contributor
13 years ago

Accessing and modifying datagen properties

Hi,

I'm do some load testing using soapUI pro and use the datagen component a lot.

I would like to know if it's possible to access and change the datagen properties (start, end, step, pattern) using a groovy script?

I tried this but I'm not sure it's the right way to proceed :

testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().getStartValue();
testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().getEndValue();
testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().getStepValue();
testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().getPattern();

testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().setStartValue();
testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().setEndValue("100");
testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().setStepValue();
testRunner.testCase.getTestStepByName("DataGen").getPropertyAt(0).getProperty().setPattern();

Thanks,

Mathieu
  • Hi!

    Yes, this currently the right way to access those values using Groovy.

    --
    Regards

    Erik
    SmartBear Sweden
  • mforgues's avatar
    mforgues
    Occasional Contributor
    Hi,

    Thanks I was able to set the values.

    Is there a method to refresh the ui after setting the values?

    Currently the ui is blank but the values are taken into account.

    Mathieu
  • Hmm...
    Sorry I don't believe there's any easy way to to that using the API.

    --
    Regards

    Erik
    SmartBear Sweden