SOAPUI如何生成动态请求密码?
我需要动态地生成请求的密码,因为我需要将其与时间戳加在一起,并将结果与SHA-256编码以获取实际密码。
有没有办法向每个请求生成该密码?
应该在哪里创建脚本以生成密码,以及如何将其添加到请求或在请求中读取的变量中?
I need to generate the password of the request dynamically, because I need to concatenate it with a timestamp and encode the result with SHA-256 to get the actual password.
Is there a way to generate that password to every request?
Where should the script be created to generate the password, and how can it be added to the request or to a variable that is read in the request?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在Soapui中完全访问Groovy语言。您可以在Groovy脚本测试步骤中进行任何形式的编码。然后,您可以将结果值存储在a :
在请求xml中,您将要从属性读取的值进行参数化:
唯一的收获是您必须在肥皂请求步骤之前执行Groovy步骤,但可以在测试案例级别或在循环循环开朗,具体取决于您的项目结构。我通常会有一个令人愉悦的脚本,该脚本:
从循环中的
You have full access to the Groovy language in SoapUI. You can do any sort of coding in a Groovy script test step. Then you can store the resulting value in a property:
And in the request XML you parameterize the value to be read from the property:
The only catch is that you will have to execute the Groovy step before the SOAP request step, but that can be done at test case level, or in a loop in Groovy, depending on your project structure. I usually have a Groovy script that:
in a loop.