简体   繁体   English

如何在SoapUi中使用Groovy重命名测试用例或测试步骤

[英]How to rename a Testcase or Teststep using Groovy in SoapUi

I am re factoring large sets of tests in SoapUi. 我正在重新整理SoapUi中的大量测试。 Is there a way to automate creation and renaming of test cases/test steps through Groovy? 是否有一种方法可以通过Groovy自动创建和重命名测试用例/测试步骤?

Thanks. 谢谢。

Possibly not what you're looking for but I've had some success manually editing the test suite xml using find and replace in a text editor. 可能不是您要查找的内容,但是我已经在文本编辑器中使用查找和替换手动编辑测试套件xml取得了一些成功。 You need to be careful and make sure to back up a copy. 您需要注意并确保备份副本。

There is really not so much information in the question about what you really need to achieve, but given the little you provided, one way to go would be to directly modify the soapUI project XML file. 关于您真正需要实现什么的问题确实没有太多信息,但是鉴于您所提供的内容很少,一种解决方法是直接修改soapUI项目XML文件。 I have done this with some success in the past. 过去,我已经取得了一些成功。 The last I used soapUI, it UI did not come with massive refactoring functionality. 我上次使用soapUI时,它的UI没有大量的重构功能。

You can run Groovy code within SoapUI using SoapUI Groovy Console plugin . 您可以使用SoapUI Groovy Console插件在SoapUI中运行Groovy代码。 This way, you can change any property you want programmatically (within API constraints of course). 这样,您可以以编程方式(当然在API约束内)更改所需的任何属性。

As for technical details on how to solve your actual problem, I can only refer you to this blog post and SoapUI's javadoc . 至于如何解决实际问题的技术细节,我只能将您引荐至此博客文章SoapUI的javadoc Based on the blog post, you need to figure out what's given to you, and based on the API, you need to figure out how to achieve what you need. 根据博客文章,您需要确定给您的内容,并且基于API,您需要确定如何实现所需的内容。

In my case, I started with my project being bound as a project variable, and moved on from there. 就我而言,我从将项目绑定为project变量开始,然后从那里继续。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM