phil89
15 years agoOccasional Contributor
Change workdir ?
Hi I have loaded data with an properties, and default directory seems "bin". Could i load data file from the directory where is stored SOAPUI xml file ? Regards Philippe
//read the file
def properties = new java.util.Properties();
properties.load( new java.io.FileInputStream("..\\..\\..\\tirablanc\\VAL\\props_patricia_val30.properties" ));
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) log.info( groovyUtils.projectPath )
def targetStep = testRunner.testCase.getTestStepByName( "Properties" );
// assign single property
targetStep.setPropertyValue( "nom", properties.getProperty( "nom"+context.getProperty( "RunCount")));
targetStep.setPropertyValue( "prenom", properties.getProperty( "prenom"+context.getProperty( "RunCount") )); targetStep.setPropertyValue( "clef", properties.getProperty( "clef"+context.getProperty( "RunCount") ));
targetStep.setPropertyValue( "inst", properties.getProperty( "inst"+context.getProperty( "RunCount") ));
targetStep.setPropertyValue( "nir", properties.getProperty( "nir"+context.getProperty( "RunCount") ));</script>
</con:config>