Forum Discussion
Kronos_Support
15 years agoOccasional Contributor
Hi,
I am able to create groovy using following code at test case level and set the property for the path file name to be loaded.
def path = testRunner.testCase.testSuite.project.getPath();
int pathIdx = path.lastIndexOf("\\");
String pathS = path.substring(0, pathIdx);
log.info("pathS is: " + pathS);
String propFilePath = pathS.concat("\\Global.properties");
log.info("propFilePath is: " + propFilePath)
testRunner.testCase.testSuite.project.setPropertyValue( "propFilePath", propFilePath)
The output log shows:
Wed Jul 06 16:32:53 EDT 2011:INFO:pathS is: Z:\LoadOpenShift
Wed Jul 06 16:32:53 EDT 2011:INFO:propFilePath is: Z:\LoadOpenShift\Global.properties
The property "propFilePath" and it's value is set at the project level successfully. Now I am trying to load this external property file at project level giving "${#Project#propFilePath}" value but, I am still getting following error:
Wed Jul 06 16:34:05 EDT 2011:ERROR:An error occured [${#Project#propFilePath} (The system cannot find the file specified)], see error log for details
All I want is I want to load external global property file at project level so, that I can give user option of changing the endpoint server names to apply for the project.
Please help me solve this as I am blocked by this.
thank you
PJ
I am able to create groovy using following code at test case level and set the property for the path file name to be loaded.
def path = testRunner.testCase.testSuite.project.getPath();
int pathIdx = path.lastIndexOf("\\");
String pathS = path.substring(0, pathIdx);
log.info("pathS is: " + pathS);
String propFilePath = pathS.concat("\\Global.properties");
log.info("propFilePath is: " + propFilePath)
testRunner.testCase.testSuite.project.setPropertyValue( "propFilePath", propFilePath)
The output log shows:
Wed Jul 06 16:32:53 EDT 2011:INFO:pathS is: Z:\LoadOpenShift
Wed Jul 06 16:32:53 EDT 2011:INFO:propFilePath is: Z:\LoadOpenShift\Global.properties
The property "propFilePath" and it's value is set at the project level successfully. Now I am trying to load this external property file at project level giving "${#Project#propFilePath}" value but, I am still getting following error:
Wed Jul 06 16:34:05 EDT 2011:ERROR:An error occured [${#Project#propFilePath} (The system cannot find the file specified)], see error log for details
All I want is I want to load external global property file at project level so, that I can give user option of changing the endpoint server names to apply for the project.
Please help me solve this as I am blocked by this.
thank you
PJ