Forum Discussion
Hi porcupineRabbit,
I have made a number of experiments but failed to find an easy way to modify the Duplicate Each Value parameter of the generator from the Groovy script so far. Can you please submit a case using this link so that we could perform a more thorough investigation and consult the developers?
Also, please describe your testing scenario more precisely as there may be some other ways to achieve the goal.
Hello JKolosova ,
thank you for your interest and yes, you are right. There is no easy way to do that, since "Geta Data" option is not available for this field when you right-click.
I managed to develop a groovy function that performs this task, after a (rather long and thorough) research in old and new readyAPI / soapUI documentation pages! You can see the method below, but I will also open a support ticket as you suggested, so the dev team can investigate if this task can become less "tedious" (I had my fun share building this) 😊
void setGeneratorDuplicateValue(WsdlDataSourceTestStep generatorStep, String propertyItem, int duplicationValue) {
DataSource oDataGen = generatorStep.getDataSource()
GeneratorDescriptor genDescriptor = oDataGen.getDescriptorForProperty(propertyItem)
PropertyTypeBasePanel propTypeBase = genDescriptor.getTab()
propTypeBase.setDuplicateValue(duplicationValue)
genDescriptor.setUpdated(true)
oDataGen.setGeneratorDescriptor(genDescriptor)
genDescriptor = null
}
// How to call it
// def objDataGenStep = context.testCase.testSuite.getTestCaseByName("Test_Case_Name").testSteps["Data Generator"]
// setGeneratorDuplicateValue(objDataGenStep,"autoNumber", neededRows)
What I am trying to achieve is:
I perform some load tests and I have an excel file (data source) with the data rows needed. Each run needs a different number of rows, depending on the workload. The task is to change the duplicate values assigned from the Data Generator, according to the data rows. For example, if I set the data source to get 25 rows, the generator must duplicate the same number of values (25 that is), from a given set. If you need more insight please say so, since this is an already long post.
Finally, it would be great if the ReadyAPI API documentation had some comments for the methods / objects available. If I can also open a support ticket for this, please let me know.
Thank you for your help
Related Content
- 6 years ago
- 2 years ago
Recent Discussions
- 20 days ago