51Testing软件测试论坛
标题:
Loadrunner测试webservice的问题
[打印本页]
作者:
YapsiLee
时间:
2014-8-11 17:34
标题:
Loadrunner测试webservice的问题
本帖最后由 YapsiLee 于 2014-8-12 08:40 编辑
大家好,见以下代码,求助!!!
第一个调用remoteControl方法后,服务器会返回一个流水号Control_return;这个流水号会被下一个方法getResultBySerial调用。因为涉及到网络延迟,方法getResultBySerial拿到结果的时间是不是固定的。
拿结果的方法为:每3秒取一次结果,返回为3508即停止;如果拿到的结果为Null(开发告知)则继续;5次仍没拿到结果,即判断为失败;
现在的问题为:3秒内拿到3508时成功,但是服务器返回null(开发告知)时,提示无return返回值。
web_service_call( "StepName=remoteControl", "SOAPMethod=CommandImpl4WSService|CommandImpl4WSPort|remoteControl",
"ResponseParam=response",
"Service=CommandImpl4WSService",
"ExpectedResponse=SoapResult",
"Snapshot=t1407487439.inf",
BEGIN_ARGUMENTS,
"md5Imsi=F6903D00FB017220201BB6F7D95F14B2",
"cmdType=InvalidState",
"cmdTypeSpecified=true",
"cmdSource=InvalidState",
"cmdSourceSpecified=true",
END_ARGUMENTS,
BEGIN_RESULT,
"return=Control_return",
END_RESULT,
LAST);
lr_think_time(3); //请注意此处
web_service_call( "StepName=getResultBySerial", "SOAPMethod=CommandImpl4WSService|CommandImpl4WSPort|getResultBySerial",
"ResponseParam=response",
"Service=CommandImpl4WSService",
"ExpectedResponse=SoapResult",
"Snapshot=t1407489242.inf",
BEGIN_ARGUMENTS,
"md5Imsi=F6903D00FB017220201BB6F7D95F14B2",
"requestSerial={Control_return}",
END_ARGUMENTS,
BEGIN_RESULT,
"return=Result_return",
END_RESULT,
LAST);
复制代码
作者:
云层
时间:
2014-8-12 13:16
表示完全看不懂你想问啥,既然你知道要查5次了做个循环自己关联服务器返回不就好了?
作者:
YapsiLee
时间:
2014-8-12 13:58
回复
2#
云层
欢迎版主光临来帮忙,我可能没说清楚,sorry。再解释一下:在调用getResultBySerial的时候,服务器如果返回的是null,也就是return=Result_return中的Result_return为null(这个并不是我打印日志查看到的,而是开发人员告知的)。web_service_call( "StepName=getResultBySerial"),这个调用就会报error,然后停止。
不知道版主听懂了没?
作者:
YapsiLee
时间:
2014-8-12 16:25
补充一下,错误日志。
Action.c(35): Error: The result argument "return" was not found in the server response
Action.c(35): Error: Web service call "getResultBySerial" execution failed
复制代码
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2