pla*_*irt 5 groovy soapui load-testing
我尝试从中的测试用例生成负载测试SoapUI。它有很多测试步骤,前10个步骤涵盖了登录过程。LoadTest在Groovy脚本中停止,该脚本应该从上一个测试步骤的输出中获取参数值。当直接执行时,它可以正常工作,但是当以a执行时,它会给出错误LoadTest:
groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String# . Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [class [B] [class [C] [class java.lang.String] groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.lang.String# . Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [class [B] [class [C] [class java.lang.String] error at line: 5
Run Code Online (Sandbox Code Playgroud)
Groovy 导致上述错误的脚本:
def tc1 = testRunner.testCase.getTestStepAt(context.currentStepIndex-1);
String rawData = new String(tc1.testRequest.response.rawResponseData);
Reger reger = new Reger(rawData);
String myvar1 = reger.getNthMatch(/<myregex>/, 0);
Run Code Online (Sandbox Code Playgroud)
小智 2
您在该字符串中的问题:
String rawData = new String(tc1.testRequest.response.rawResponseData)
Run Code Online (Sandbox Code Playgroud)
tc1.testRequest.response.rawResponseData为空
因此,为了防止异常,您可以将此字符串更改为:
String rawData = tc1.testRequest.response.rawResponseData?.toString()
Run Code Online (Sandbox Code Playgroud)
这是空安全的
| 归档时间: |
|
| 查看次数: |
127 次 |
| 最近记录: |