Joe_DuBois
16 years agoOccasional Contributor
Dynamic Property (Setting properties load filename)
First, tried doing a search, and found the Data Gen step, which it would seem like what I need (I assume that would allow me to input a value when running the Test Case) but we are a Hospital and under the current financial market we are looking at just he plain version.
So what I'm trying to do is set it up so a Test Case can run against different sets of data. This seems to make sense to load the values into properties files, now rather than change the script each time I want to change the properties files, I thought it would make sense to setup a project property "testpropFilename" which I could then use in the properties.load method (below).
But when I try to run it, it gives me no such property.
I've tried defining it at several levels. At the Test Case/properties level, At the Test Suite level, Project level. But still same result, MissingPropertyException "No such property testpropFilename".
Please help
Joe
So what I'm trying to do is set it up so a Test Case can run against different sets of data. This seems to make sense to load the values into properties files, now rather than change the script each time I want to change the properties files, I thought it would make sense to setup a project property "testpropFilename" which I could then use in the properties.load method (below).
But when I try to run it, it gives me no such property.
def properties = new java.util.Properties();
properties.load( new java.io.FileInputStream( "C:/workplace/work/Testing/temp/${testpropFilename}" ));
I've tried defining it at several levels. At the Test Case/properties level, At the Test Suite level, Project level. But still same result, MissingPropertyException "No such property testpropFilename".
Please help
Joe