Saving project properties in SoapUI's groovy

一笑奈何 提交于 2019-12-13 05:16:18

问题


Here is my problem. 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?


回答1:


If you modify anything in your project, and you want to preserve that from one run to the next, use the -S (uppercase) switch.

Documentation is your friend. :)



来源:https://stackoverflow.com/questions/26460598/saving-project-properties-in-soapuis-groovy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!