51Testing软件测试论坛

标题: 用loadrunner 测试web 系统的 web services问题 [打印本页]

作者: tiancom    时间: 2010-7-21 09:29
标题: 用loadrunner 测试web 系统的 web services问题
1、  确认该web services是有效的。选择web service 协议 ,录制B/S应用程序的时候仍按照普通的访问该页面URL方式来录制操作吗?

2、为什么我录制完毕后 跟之前http协议的差别很大,里面没有任何与页面逻辑相关的代码?

3、录制完成后扫描 WSDL文档,或者选择Web services  URL并点击自动生成脚本,生成的脚本该插入到什么位置?

4、还有我在录制中定义的事务  在脚本中都是空的?这是什么原因呢

<start 事务1>

<end 事务1 LAST>
作者: tiancom    时间: 2010-7-21 09:34
Action()
{

        /* Registering parameter(s) from source task id 6
        // {JSESSIONID2} = "DSCcMGJTY51VjWv4ZGdpzWx9cCyyQJTLKZwsXmfTXYcJhQjjDLR5!597643344"
        // */

        web_add_auto_header("User-Agent", "Post_Multipart");

        web_add_auto_header("Accept-Encoding", "gzip, deflate");

        web_add_auto_header("Accept-Language", "zh-cn");

        web_add_auto_header("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

        web_revert_auto_header("Accept-Encoding");

        web_revert_auto_header("Accept-Language");

        lr_start_transaction("区域");

        web_add_auto_header("User-Agent", "Post_Multipart");

        lr_end_transaction("区域",LR_AUTO);

        lr_start_transaction("位置");

        web_add_auto_header("Accept-Encoding", "gzip, deflate");

        web_add_auto_header("Accept-Language", "zh-cn");

        web_add_auto_header("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

        web_add_header("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

        web_add_header("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");

        lr_end_transaction("位置",LR_AUTO);

        return 0;
}
作者: tiancom    时间: 2010-7-21 09:35
以上是我录制的脚本,我该把 wsdl 放到哪个位置
作者: dionysus    时间: 2010-7-21 09:45
没看到有web_service_call()函数啊,lz的录制步骤不对
作者: tiancom    时间: 2010-7-21 11:40
Action()
{
//查询北京海淀区
        lr_start_transaction("区域");

        web_add_auto_header("Accept-Encoding",
                "gzip, deflate");

        web_add_auto_header("Accept-Language",
                "zh-cn");

        web_add_auto_header("User-Agent",
                "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)");

        lr_end_transaction("区域", LR_AUTO);

//查询具体位置=中关村

        lr_start_transaction("位置");



        web_service_call( "StepName=findLocationInfoByName_102",
                "SOAPMethod=LocationManage.LocationManagePortType.findLocationInfoByName",
                "ResponseParam=response",
                "WSDL=http://172.28.75.90:7001/itis_webservice/locationService?wsdl",
                "UseWSDLCopy=1",
                "Snapshot=t1279679891.inf",
                BEGIN_ARGUMENTS,
                "xml:in0=<in0><distID>auto string</distID><matchType>auto string</matchType>"
                                "<maxRowCount>123456789</maxRowCount><name>wudaokou</name><pageNo>"
                                "123456789</pageNo><pageSize>123456789</pageSize><searchSortType>"
                                "POI</searchSortType><showCount>123456789</showCount><showStartIdx>"
                                "123456789</showStartIdx><singleLocateId><long>123456789</long></singleLocateId>"
                                "<srcServiceModule>HIGHWAY_EVENT</srcServiceModule></in0>",
                END_ARGUMENTS,
                BEGIN_RESULT,
                "out/statusCode=Param_statusCode",
                END_RESULT,
                LAST);
        lr_think_time(3);



        web_add_header("Content-Type",
                "application/x-www-form-urlencoded; charset=UTF-8");

        web_add_header("Content-Type",
                "application/x-www-form-urlencoded; charset=UTF-8");

        lr_end_transaction("位置", LR_AUTO);

        return 0;
}
作者: tiancom    时间: 2010-7-21 11:40
这会上  包含 web_service_call()函数的脚本
作者: tiancom    时间: 2010-7-21 11:41
把这个web_service_call()函数放这里 位置对吗?
作者: archonwang    时间: 2010-7-21 16:23
可以直接拿wsdl,声称他wscall。
作者: tiancom    时间: 2010-7-21 21:52
用loadrunner 8.1 回放的时候总是报错, 无法运行

是不是 8.1 对web services兼容不好啊
作者: tiancom    时间: 2010-7-21 21:54
原帖由 archonwang 于 2010-7-21 16:23 发表
可以直接拿wsdl,声称他wscall。

我就是直接拿wsdl 来引入的,调用 web service call
作者: tiancom    时间: 2010-7-26 14:46
没有人帮我吗?




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2