51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1376|回复: 2
打印 上一主题 下一主题

[求助] loadrunne录制GWT时,无法参数化,请高手解救啊。跪拜

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2012-8-22 17:42:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我最近在用loadrunner录制GWT的时候分别选择的协议web(http/html)、ajax(click和sript)、web(click和sript)这是三个,录制的格式是url 的,但是录制完成后,没法参数化。所有要提交的数据都在web_custom_request函数的body了。以下录制的web_custom_request函数的代码:
web_add_auto_header("Accept",
                "*/*");

        web_add_auto_header("Cache-Control",
                "no-cache");

        lr_think_time(27);

        web_custom_request("IDACall",
                "URL=http://192.168.0.204:8080/planmis/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2011-10-04&isc_xhr=1&isc_tnum=1",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/plain",
                "Referer=http://192.168.0.204:8080/#main",
                "Snapshot=t124.inf",
                "Mode=HTTP",
                "EncType=application/x-www-form-urlencoded; charset=UTF-8",
                "Body=_transaction="
                "%3Ctransaction%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum%20xsi%3Atype%3D%22xsd%3Along%22%3E1%3C%2FtransactionNum%3E%3Coperations%20xsi%3Atype%3D%22xsd%3AList%22%3E%3Celem%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3Ccriteria%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2Fcriteria%3E%3CoperationConfig%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CdataSource%3EsupplyItemSpringDMI%3C%2FdataSource%3E%3CoperationType%3Efetch%3C%2F"
                "operationType%3E%3CtextMatchStyle%3Esubstring%3C%2FtextMatchStyle%3E%3C%2FoperationConfig%3E%3CstartRow%20xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FstartRow%3E%3CendRow%20xsi%3Atype%3D%22xsd%3Along%22%3E10%3C%2FendRow%3E%3CcomponentId%3Eisc_ListGrid_0%3C%2FcomponentId%3E%3CappID%3EbuiltinApplication%3C%2FappID%3E%3Coperation%3EsupplyItemSpringDMI_fetch%3C%2Foperation%3E%3ColdValues%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2FoldValues%3E%3C%2Felem%3E%3C%2Foperations%3E%3C%2Ftransaction%3E&"
                "protocolVersion=1.0",
                LAST);

        web_custom_request("IDACall_2",
                "URL=http://192.168.0.204:8080/planmis/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2011-10-04&isc_xhr=1&isc_tnum=2",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/plain",
                "Referer=http://192.168.0.204:8080/#jhgz%E9%87%8D%E7%82%B9%E5%B7%A5%E4%BD%9C",
                "Snapshot=t125.inf",
                "Mode=HTTP",
                "EncType=application/x-www-form-urlencoded; charset=UTF-8",
                "Body=_transaction="
                "%3Ctransaction%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum%20xsi%3Atype%3D%22xsd%3Along%22%3E2%3C%2FtransactionNum%3E%3Coperations%20xsi%3Atype%3D%22xsd%3AList%22%3E%3Celem%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3Ccriteria%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2Fcriteria%3E%3CoperationConfig%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CdataSource%3EsupplyItemSpringDMI%3C%2FdataSource%3E%3CoperationType%3Efetch%3C%2F"
                "operationType%3E%3CtextMatchStyle%3Esubstring%3C%2FtextMatchStyle%3E%3C%2FoperationConfig%3E%3CstartRow%20xsi%3Atype%3D%22xsd%3Along%22%3E0%3C%2FstartRow%3E%3CendRow%20xsi%3Atype%3D%22xsd%3Along%22%3E20%3C%2FendRow%3E%3CcomponentId%3Eisc_ListGrid_0%3C%2FcomponentId%3E%3CappID%3EbuiltinApplication%3C%2FappID%3E%3Coperation%3EsupplyItemSpringDMI_fetch%3C%2Foperation%3E%3ColdValues%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2FoldValues%3E%3C%2Felem%3E%3C%2Foperations%3E%3C%2Ftransaction%3E&"
                "protocolVersion=1.0",
                LAST);

        web_custom_request("IDACall_3",
                "URL=http://192.168.0.204:8080/planmis/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2011-10-04&isc_xhr=1&isc_tnum=3",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/plain",
                "Referer=http://192.168.0.204:8080/#jhgz%E9%87%8D%E7%82%B9%E5%B7%A5%E4%BD%9C",
                "Snapshot=t126.inf",
                "Mode=HTTP",
                "EncType=application/x-www-form-urlencoded; charset=UTF-8",
                "Body=_transaction="
                "%3Ctransaction%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum%20xsi%3Atype%3D%22xsd%3Along%22%3E3%3C%2FtransactionNum%3E%3Coperations%20xsi%3Atype%3D%22xsd%3AList%22%3E%3Celem%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3Ccriteria%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2Fcriteria%3E%3CoperationConfig%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CdataSource%3EsupplyItemSpringDMI%3C%2FdataSource%3E%3CoperationType%3Efetch%3C%2F"
                "operationType%3E%3CtextMatchStyle%3Esubstring%3C%2FtextMatchStyle%3E%3C%2FoperationConfig%3E%3CstartRow%20xsi%3Atype%3D%22xsd%3Along%22%3E10%3C%2FstartRow%3E%3CendRow%20xsi%3Atype%3D%22xsd%3Along%22%3E20%3C%2FendRow%3E%3CcomponentId%3Eisc_ListGrid_0%3C%2FcomponentId%3E%3CappID%3EbuiltinApplication%3C%2FappID%3E%3Coperation%3EsupplyItemSpringDMI_fetch%3C%2Foperation%3E%3ColdValues%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2FoldValues%3E%3C%2Felem%3E%3C%2Foperations%3E%3C%2Ftransaction%3E&"
                "protocolVersion=1.0",
                LAST);

        web_custom_request("IDACall_4",
                "URL=http://192.168.0.204:8080/planmis/sc/IDACall?isc_rpc=1&isc_v=SC_SNAPSHOT-2011-10-04&isc_xhr=1&isc_tnum=4",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/plain",
                "Referer=http://192.168.0.204:8080/#jhgz%E9%87%8D%E7%82%B9%E5%B7%A5%E4%BD%9C",
                "Snapshot=t127.inf",
                "Mode=HTTP",
                "EncType=application/x-www-form-urlencoded; charset=UTF-8",
                "Body=_transaction="
                "%3Ctransaction%20xmlns%3Axsi%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2F10%2FXMLSchema-instance%22%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CtransactionNum%20xsi%3Atype%3D%22xsd%3Along%22%3E4%3C%2FtransactionNum%3E%3Coperations%20xsi%3Atype%3D%22xsd%3AList%22%3E%3Celem%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3Ccriteria%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2Fcriteria%3E%3CoperationConfig%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3CdataSource%3EsupplyItemSpringDMI%3C%2FdataSource%3E%3CoperationType%3Efetch%3C%2F"
                "operationType%3E%3CtextMatchStyle%3Esubstring%3C%2FtextMatchStyle%3E%3C%2FoperationConfig%3E%3CstartRow%20xsi%3Atype%3D%22xsd%3Along%22%3E20%3C%2FstartRow%3E%3CendRow%20xsi%3Atype%3D%22xsd%3Along%22%3E30%3C%2FendRow%3E%3CcomponentId%3Eisc_ListGrid_0%3C%2FcomponentId%3E%3CappID%3EbuiltinApplication%3C%2FappID%3E%3Coperation%3EsupplyItemSpringDMI_fetch%3C%2Foperation%3E%3ColdValues%20xsi%3Atype%3D%22xsd%3AObject%22%3E%3C%2FoldValues%3E%3C%2Felem%3E%3C%2Foperations%3E%3C%2Ftransaction%3E&"
                "protocolVersion=1.0",
                LAST);

        web_concurrent_start(NULL);

        web_url("hthumb_grip.png",
                "URL=http://192.168.0.204:8080/planmis/sc/skins/Enterprise/images/Scrollbar/hthumb_grip.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://192.168.0.204:8080/",
                "Snapshot=t128.inf",
                LAST);

        web_url("hthumb_stretch.png",
                "URL=http://192.168.0.204:8080/planmis/sc/skins/Enterprise/images/Scrollbar/hthumb_stretch.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://192.168.0.204:8080/",
                "Snapshot=t129.inf",
                LAST);

        web_url("hscroll_track.png",
                "URL=http://192.168.0.204:8080/planmis/sc/skins/Enterprise/images/Scrollbar/hscroll_track.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://192.168.0.204:8080/",
                "Snapshot=t130.inf",
                LAST);

        web_url("page-prev.gif",
                "URL=http://192.168.0.204:8080/images/page-prev.gif",
                "Resource=1",
                "RecContentType=image/gif",
                "Referer=http://192.168.0.204:8080/",
                "Snapshot=t131.inf",
                LAST);

        web_concurrent_end(NULL);

        web_revert_auto_header("Accept");

        web_revert_auto_header("Accept-Encoding");

        web_revert_auto_header("Accept-Language");

        lr_think_time(33);

        web_custom_request("uup.php",
                "URL=http://uup.f.360.cn/uup.php",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/plain",
                "Referer=",
                "Snapshot=t132.inf",
                "Mode=HTTP",
                "EncType=application/octet-stream",
                "BodyBinary=\\x0C\\x05\\x00\\x00\\x01-\\x00\\x00\\x00\\x00\\x00\\x05\\x02\\x00\\x04\\x00\\x08龤l'X (/娥J豔貒h琞栺饊~;\n蚒茢\\x9C<塵\\x12L&bぇ3\\x16ze3.E\\xE44蜱Q4閂L\\x05Wde糩a\\x8F\\x0CH 莰揲斡遗dH醨!鰘\\x1A4睮茏J&_K\\x1657湌a怤曂$\\x89\t\\x07#\\xA9<\\x08擊泉\\x80冽Ю\\x16縻\\x08ZdDP\\x8B\\x0E`\\xB5\\x08\\x14鈤H鶐8mO矕\\xDF \\x1E\\\\_滾y\\x0BAe踡\\xFC-糡\\xD4?O\\x17穄}V\\x13D\\x92>n魄\\xFF\\xD4\\xFF贫X\\xBA\\x0EM\rs\tXv\\x1D\\xAD\\xFF(d#\\x17砈7\\x1C\"劰襍\\x90*\\xD1\\x00u;@韬藜/"
                "5F椴\\xED7\\x08\\x04{ 餹L\\x180麃\\x17^韄\\x90\\x05鷭0缐nn鸙揌\\\\F燛\\x1C\\xD6;x\\xFE:枢Um=3V\\x1A\\xE1'\\x12Q,\\x0F濁穼>\\xA45莆",
                LAST);

        web_add_header("Accept",
                "*/*");

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

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

        web_concurrent_start(NULL);

        web_url("header_menu.png",
                "URL=http://192.168.0.204:8080/planmis/sc/skins/Enterprise/images/ListGrid/header_menu.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://192.168.0.204:8080/",
                "Snapshot=t133.inf",
                LAST);

        web_add_header("Accept",
                "*/*");

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

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

        web_url("button_Down_start.png_2",
                "URL=http://192.168.0.204:8080/planmis/sc/skins/Enterprise/images/button/button_Down_start.png",
                "Resource=1",
                "RecContentType=image/png",
                "Referer=http://192.168.0.204:8080/",
                "Snapshot=t134.inf",
                LAST);

        web_concurrent_end(NULL);
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2012-8-23 09:32:30 | 只看该作者
1.用Html录制
2.用lr11的DFE功能转XML
回复 支持 反对

使用道具 举报

该用户从未签到

3#
发表于 2012-8-23 10:41:57 | 只看该作者
个人觉得这种情况也是可以参数化的,但那是需要主意
1.参数不要使用中文(英文和数据均可)
2.你提交的参数在body部分,录制两份脚本进行比对(参数尽量特殊化,这样容易比对)
3.找参数的时候细心点!
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-11-7 20:52 , Processed in 0.065250 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表