Forum Discussion

anand1's avatar
anand1
Contributor
12 years ago

[Resolved] Setting Value in DataGen Test Step

In my test at one point I am getting the value from a Datagen property using
context.expand( '${DataGen#Var1}' )
Now after doing some manipulation I need to set the value back...in the same test step i.e.Datagen
I tried :-
testRunner.testCase.testSteps["DataGen"].setPropertyValue( "Var1", m )
It is not working, then I tried
groovyUtils.setPropertyValue('DataGen', 'Var1', m), even this is also not working.

What should I do to set the value in the same property variable named as Var1..?

Looking forward for a reply.......
  • Hi,

    This line should work:
    testRunner.testCase.testSteps["DataGen"].getProperty("Var1").setValue(m) //accepts a String
    Please try on your end.

    Regards,

    Giscard
    SmartBear Support
  • no it is not working as when I tried to get it a variable to see what is the value now..i can see it as Null.

    I checked my Datagen#property, the value is not updated,BTW will that depend of what type of variable I have defined in my Datagen Teststep, well as of now Var1 is of Template type..

    Any thoughts...?
  • Hi,

    I am not sure of the exact expectation from setting the value of different types of DataGen properties in the way it's currently implemented. But can you tell me more about what you are trying to accomplish in your test scenario? Are you looking to update the DataGen property value because you are referring to it again later in your TestCase? There may be a different approach.

    Thanks,

    Giscard
    SmartBear Support
  • Please ignore the same I am able to move forward in another way...Thanks