jsj_06_lf 发表于 2012-8-28 16:00:41

loadrunner gwt

用loadrunner11测试gwt框架的东西,选择的AJAX(Click and Script)协议,录制的是一个登录的过程(包括登录和权限菜单的获取),录出来的代码如下:
lr_start_transaction("login");
        web_button("BUTTON",
                "Snapshot=t5.inf",
                DESCRIPTION,
                "Type=button",
                "Tag=BUTTON",
                "ID=",
                ACTION,
                "UserAction=Click",
                LAST);
lr_end_transaction("login",LR_AUTO);

回放时,日志如下
Action.c(50): Notify: Transaction "login" started.
Action.c(52): Downloading URL "http://10.10.77.15:7001/Center/centerconsole/loginService.do" for an ActiveX object (asynchronous POST request)       
Action.c(52): Resource "http://10.10.77.15:7001/Center/centerconsole/clear.cache.gif" is in the cache already and will not be downloaded again       
Action.c(52): Downloading URL "http://10.10.77.15:7001/Center/centerconsole/resourcesService.do" for an ActiveX object (asynchronous POST request)       
Action.c(52): Downloading resource "http://10.10.77.15:7001/Center/images/registry32.png" (detected in HTML)       
Action.c(52): web_button("BUTTON") was successful, 6481 body bytes, 721 header bytes       
Action.c(62): Notify: Transaction "login" ended with "Pass" status (Duration: 4.3088 Wasted Time: 0.0053).
里面包含了loginService.do和resourcesService.do,这两个正是前面提到的登录和菜单权限的过程,那是不是就说明我录制的脚本是没有问题了
因为感觉录下来的东西太少了,所以总感觉不是很正确,望哪位指点下,谢谢!

云层 发表于 2012-8-28 17:42:26

不推荐使用ajax协议,换http/html吧

jsj_06_lf 发表于 2012-8-29 08:56:57

回复 2# 云层
那用http协议可以录gwt框架的东西吗?我之前用web(http/html)录过,可一回放的时候就报错,这是部分录的代码
web_custom_request("apConfigureServiceController.do",
                "URL=http://10.10.77.15:7001/Center/apConfigureServiceController.do",
                "Method=POST",
                "Resource=0",
                "RecContentType=application/json",
                "Referer=http://10.10.77.15:7001/Center/",
                "Snapshot=t8.inf",
                "Mode=HTML",
                "EncType=text/x-gwt-rpc; charset=utf-8",
                "Body=6|0|4|http://10.10.77.15:7001/Center/centerconsole/|CA572247D9B4F87464FEB057C56E1E96|net.carefx.ap.web.gwt.client.service.ApConfigureService|getApConfigure|1|2|3|4|0|",
                LAST);

        lr_start_transaction("login");

        lr_think_time(24);

        web_custom_request("loginService.do",
                "URL=http://10.10.77.15:7001/Center/centerconsole/loginService.do",
                "Method=POST",
                "Resource=0",
                "RecContentType=application/json",
                "Referer=http://10.10.77.15:7001/Center/",
                "Snapshot=t9.inf",
                "Mode=HTML",
                "EncType=text/x-gwt-rpc; charset=utf-8",
                "Body=6|0|7|http://10.10.77.15:7001/Center/centerconsole/|5C87B5E1F034DB690DC5AB20387D7511|com.supcon.center.security.client.service.LoginService|validate|java.lang.String/2004016611|heren|1111|1|2|3|4|2|5|5|6|7|",
                LAST);

        web_custom_request("resourcesService.do",
                "URL=http://10.10.77.15:7001/Center/centerconsole/resourcesService.do",
                "Method=POST",
                "Resource=0",
                "RecContentType=application/json",
                "Referer=http://10.10.77.15:7001/Center/",
                "Snapshot=t10.inf",
                "Mode=HTML",
                "EncType=text/x-gwt-rpc; charset=utf-8",
                "Body=6|0|6|http://10.10.77.15:7001/Center/centerconsole/|B6FDC5B998A1EF4590AF684611671B9A|com.supcon.center.rbac.client.service.ResourcesService|findResourceById|java.lang.String/2004016611|heren|1|2|3|4|1|5|6|",
                LAST);
        lr_end_transaction("login",LR_AUTO);
一直报
Action.c(49): Error -26612: HTTP Status-Code=500 (Internal Server Error) for "http://10.10.77.15:7001/Center/apConfigureServiceController.do"       
Action.c(49): web_custom_request("apConfigureServiceController.do") highest severity level was "ERROR", 57 body bytes, 121 header bytes       
然后我查看了该项目对应的weblogic的日志,日志里面记录的是
ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <5a0f9cb30a6fd9e0:6e6ebb55:1392e8a4292:-8000-00000000000052ec> <1346120818734> <BEA-000000> <Exception while dispatching incoming RPC call
javax.servlet.ServletException: Content-Type was '(null)'. Expected 'text/x-gwt-rpc'.
我问开发人员开发人员说是空指针,然后就没理我了。
我也不知道该怎么办了

jsj_06_lf 发表于 2012-8-29 16:52:50

回复 4# xzf2001
发送的什么数据呢,里面只涉及到用户名、密码,用户名和密码都是录制的,没进行过处理

jsj_06_lf 发表于 2012-9-3 13:41:04

求指教,求支援{:3_69:}

sunlight426 发表于 2013-5-30 16:38:22

我也遇到了同样的问题。开发用的gwt2.5的框架,我测试时使用http/html方式,选择url_based_Script的录制方式。脚本运行到如下语句就报500:
       web_custom_request("info",
               "URL=http://192.168.2.200:8888/lsgl/webwin/common/info",
               "Method=POST",
               "Resource=0",
               "RecContentType=application/json",
               "Referer=http://192.168.2.200:8888/lsgl/",
               "Snapshot=t20.inf",
               "Mode=HTTP",
               "EncType=text/x-gwt-rpc; charset=utf-8",
               "X-GWT-Permutation: A1B37093B9E7ABF8F565185196EA34A6"
               "X-GWT-Module-Base: http://192.168.2.200:8888/lsgl/webwin/"
               "Body=7|0|6|http://192.168.2.200:8888/lsgl/webwin/|BBFB295A7E20A64016FACFF68269A78C|com.chinacreator.common.client.services.InfoService|getInfo|java.lang.String/2004016611|zh-cn|1|2|3|4|1|5|6|",
               LAST);

使用httpwatch 查看请求
请求内容如下
POST /lsgl/webwin/common/info HTTP/1.1
Accept: */*
Content-Type: text/x-gwt-rpc; charset=utf-8
X-GWT-Permutation: A1B37093B9E7ABF8F565185196EA34A6
X-GWT-Module-Base: http://192.168.2.200:8888/lsgl/webwin/
Referer: http://192.168.2.200:8888/lsgl/
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
Host: 192.168.2.200:8888
Content-Length: 186
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: SUBSYSTEM_COOKIE_ID_lishu=module; login_choosetype=normalUI; JSESSIONID=7A3CEB10667C9351506B6BFA62AB18E8

7|0|6|http://192.168.2.200:8888/lsgl/webwin/|BBFB295A7E20A64016FACFF68269A78C|com.chinacreator.common.client.services.InfoService|getInfo|java.lang.String/2004016611|zh-cn|1|2|3|4|1|5|6|

sunlight426 发表于 2013-5-30 16:38:59

"X-GWT-Permutation: A1B37093B9E7ABF8F565185196EA34A6"
               "X-GWT-Module-Base: http://192.168.2.200:8888/lsgl/webwin/"
这部分是我自己加上去的

sunlight426 发表于 2013-5-30 17:40:27

web_add_header("X-GWT-Permutation","A1B37093B9E7ABF8F565185196EA34A6");
    web_add_header("X-GWT-Module-Base","http://192.168.2.200:8888/lsgl/webwin/");
        web_custom_request("info",
                "URL=http://192.168.2.200:8888/lsgl/webwin/common/info",
                "Method=POST",
                "Resource=0",
                "RecContentType=application/json",
                "Referer=http://192.168.2.200:8888/lsgl/",
                "Snapshot=t20.inf",
                "Mode=HTTP",
                "EncType=text/x-gwt-rpc; charset=utf-8",
                "Body=7|0|6|http://192.168.2.200:8888/lsgl/webwin/|BBFB295A7E20A64016FACFF68269A78C|com.chinacreator.common.client.services.InfoService|getInfo|java.lang.String/2004016611|zh-cn|1|2|3|4|1|5|6|",
                LAST);

我的 解决 了。机上最 上面两行,看看对你是否有帮助

changkong 发表于 2015-1-9 15:27:22

Loadrunner11以后开始支持GWT,我使用12版本的。录制GWT系统需要LoadRunner配置Data Format Extension (GWT-DFE)支持,具体可以参考loadrunner12的用户说明书。

wan8151419 发表于 2016-8-18 10:45:00

changkong 发表于 2015-1-9 15:27
Loadrunner11以后开始支持GWT,我使用12版本的。录制GWT系统需要LoadRunner配置Data Format Extension (GWT ...

我按照官方的说明配置了def支持的gwt扩展,但脚本生成时报
Warning        0        Failed to create web_convert_from_formatted step. Decoded data is empty or has invalid tags.                        WebHttpHtml14
页: [1]
查看完整版本: loadrunner gwt