11 years ago
Storing project properties using groovy
Hello, I have faced a problem and I'm already stuck with it.
I'm running TestRunner from command line in order not to launch SoapUI client. (anyway, same problem occurs when running TR straight from client, so not sure if worth mentioning but anyways...). I do it this way:
In one of my TC I retrieve data from DB, then save it to project properties this way:
Then I use it in next steps which works fine. The problem appears in other TC where, firstly, I get filename from my project properties, this way:
Then I want to use it, rename it and save to project properties again, so that it would be ready for next launch. I do it the same way:
It seems to be not saving/storing this value. Is there any way to fix this?
I'm running TestRunner from command line in order not to launch SoapUI client. (anyway, same problem occurs when running TR straight from client, so not sure if worth mentioning but anyways...). I do it this way:
testrunner <path_to_project> -r -a -f <path_to_reports> & pause
In one of my TC I retrieve data from DB, then save it to project properties this way:
testRunner.testCase.testSuite.project.setPropertyValue("key", value);
Then I use it in next steps which works fine. The problem appears in other TC where, firstly, I get filename from my project properties, this way:
def oldFilename = testRunner.testCase.testSuite.project.getPropertyValue("FILE_NAME");
Then I want to use it, rename it and save to project properties again, so that it would be ready for next launch. I do it the same way:
testRunner.testCase.testSuite.project.setPropertyValue("FILE_NAME", newFilename);
It seems to be not saving/storing this value. Is there any way to fix this?