Forum Discussion

Trojka's avatar
Trojka
Occasional Contributor
8 years ago

Using a Datasource property for the Start and End value in DataGen Teststep

Is it possible to use a Datasource property value for the Start and End values in a DataGen Teststep (type Number)?

 

I would like to pull the ranges from a Datasource Grid, this will be the outer loop. Within the Testcase, for one particular part the script will loop through the ranges generated by the DataGen teststep.

1 Reply

  • Trojka's avatar
    Trojka
    Occasional Contributor

    Solved it using this, but is this the only way?

     

    def maxNumber = context.expand( '${DataSource#MaxNumber}' )
    testRunner.testCase.getTestStepByName("IncrementTerminalId").getPropertyAt(0).getProperty().setEndValue(maxNumber);

     

    log.info testRunner.testCase.getTestStepByName("IncrementTerminalId").getPropertyAt(0).getProperty().getEndValue();