1
对不起。我相信这不是一个新问题,但我发誓我一直在寻找几天,并尝试了几种解决方案,但没有人符合我的需要。我希望你们能帮助我...SoapUI&Groovy - 如何使用Run testCase从不同的TestCase获取属性
我的问题:
- 我有它发送的bash命令我们的服务器主脚本:
TestSuite: Tools;
TestCase: sendBashCommands;
TestStep: groovycript;
- 这个测试脚本是由几个测试用例使用“运行testCase”调用的。每个测试用例有不同的bash命令:
TestSuite: ServerInfo
TestCase: getServerVersion
Property: BashCommand="cat smt | grep Version"
TestStep: Run sendBashCommands
TestCase: getServerMessage
Property: BashCommand="cat smt | grep Message"
TestStep: Run sendBashCommands
...
在我sendBashCommands .groovyScript我已经试过如下:
//def bashCmd= context.expand('${#BashCommand}');
//it returns empty;
//def bashCmd= testRunner.testCase.getPropertyValue("BashCommand");
//it returns null;
//def bashCmd= context.getTestCase().getPropertyValue("BashCommand");
//it returns null;
def bashCmd = context.expand('${#TestCase#BashCommand}');
//it also returns empty;
目前我使用的有效的解决方案与项目属性,但我真正需要的是与这些属性在测试用例的级别上调用sendBa sh命令脚本。那可能吗?我怎么能这样做?
正是我所需要的!非常感谢! – cin2e
欢迎! :) :) –