在SoapUI的Groovy中保存项目属性 [英] Saving project properties in SoapUI's groovy

查看:112
本文介绍了在SoapUI的Groovy中保存项目属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的问题。我从命令行运行TestRunner以便不启动SoapUI客户端。 (无论如何,直接从客户端运行TR时也会发生相同的问题,因此不确定是否值得一提,但无论如何...)。我这样做是这样的:

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


在我的TC中,我从数据库中检索数据,然后通过以下方式将其保存到项目属性中:

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);

然后我在下一步中使用它可以正常工作。问题出现在其他TC中,首先,我通过 从项目属性中获取文件名:

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?

推荐答案

如果您修改了项目中的任何内容,并且希望保留一次运行到下一个,使用 -S (大写)开关。

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

文档是您的朋友。 :)

这篇关于在SoapUI的Groovy中保存项目属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆