51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3342|回复: 10
打印 上一主题 下一主题

[原创] 加急!!!!!请教web_custom_request中关联问题,盼同仁解答,感谢感谢!

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-12-18 08:24:34 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
custom, web_custom_request, web, 关联, 高手
我用自动关联找到jsessionid的变量,但是对于web_custom_request中的'session-id',始终没有关联成功。
目前尝试的方法:
1:自动关联,但只能找到jsessionid的关联,找不到web_custom_request的。
2:手动关联,尝试在“web_custom_request("js-endpoint.xsp",”前加代码

        web_reg_save_param("sessionID",
                "LB='session-id'>",
                "RB=<",
                "Search=Body",
                LAST);

返回错误信息:
Action.c(76): Error -26377: No match found for the requested parameter "sessionID". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
Action.c(76): web_custom_request("js-endpoint.xsp") highest severity level was "ERROR", 73942 body bytes, 156 header bytes, 69 chunking overhead bytes          [MsgId: MMSG-26387]

请坛内各位兄弟姐妹帮忙看看,非常感谢。

下面附着Vuser的代码:注意红色字体的session-id.另event-id也是变量也没有自动生成关联,不知何解?


Action()
{

        web_add_cookie("org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE=en_US; DOMAIN=10.100.0.2");

        web_add_cookie("locale=en_US; DOMAIN=10.100.0.2");

        // [WCSPARAM WCSParam_Diff1 24 3x958g8eeduarwg5knj98rn7] Parameter {WCSParam_Diff1} created by Correlation Studio
        web_reg_save_param("WCSParam_Diff1",
                "LB=jsessionid=",
                "RB=?",
                "Ord=1",
                "RelFrameId=1",
                "Search=Body",
                "IgnoreRedirections=Yes",
                LAST);
        web_url("10.100.0.2",
                "URL=http://10.100.0.2/",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=",
                "Snapshot=t1.inf",
                "Mode=HTML",
                EXTRARES,
                "URL=https://10.100.0.2/cas/images/lf.jpg", "Referer=https://10.100.0.2/cas/login?service=http%3A%2F%2F10.100.0.2%3A80%2Fcrm%2F", ENDITEM,
                "URL=https://10.100.0.2/cas/images/shad.gif", "Referer=https://10.100.0.2/cas/login?service=http%3A%2F%2F10.100.0.2%3A80%2Fcrm%2F", ENDITEM,
                LAST);

        web_submit_form("login;jsessionid={WCSParam_Diff1}",
                "Snapshot=t2.inf",
                ITEMDATA,
                "Name=username", "Value=admin", ENDITEM,
                "Name=password", "Value=123", ENDITEM,
                "Name=submit", "Value=Login", ENDITEM,
                EXTRARES,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/qtip/tip-sprite.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/grid/grid-blue-split.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/ajax-loader.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/logo.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/toolbar/btn-arrow.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/form/text-bg.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/form/trigger.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/s.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/toolbar/bg.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/modules/dashboard-small.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/new_add.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/switch-view.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/zoom.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/layout/mini-left.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/panel/light-hd.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/panel/tool-sprites.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/dd/drop-no.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/modules/mail-small.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/modules/appointment-small.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/modules/task-small.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/tab_add.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/tabs/tab-strip-bg.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/tabs/tabs-sprite.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/application_view_list.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/report.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/chart_curve.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/widget_add.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/img/icons/tab_edit.png", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/panel/top-bottom.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/panel/corners-sprite.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/panel/left-right.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/grid/grid3-hrow.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                "URL=http://10.100.0.2/crm/client/ext/resources/images/default/grid/group-expand-sprite.gif", "Referer=http://10.100.0.2/crm/", ENDITEM,
                LAST);

        web_custom_request("js-endpoint.xsp",
                "URL=http://10.100.0.2/crm/services/js-endpoint.xsp",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/xml",
                "Referer=http://10.100.0.2/crm/",
                "Snapshot=t3.inf",
                "Mode=HTML",
                "EncType=",
                "Body=<request><events><event name='load'/></events></request>",
                LAST);

        web_custom_request("js-endpoint.xsp_2",
                "URL=http://10.100.0.2/crm/services/js-endpoint.xsp",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/xml",
                "Referer=http://10.100.0.2/crm/",
                "Snapshot=t4.inf",
                "Mode=HTML",
                "EncType=",
                "Body=<request><variables><var id='session-id'>571331d9-f944-4854-836d-04ee33b71a84</var><var id='language-id'>en</var></variables><events><event id='591629767192138224' name='getitems'></event></events></request>",
                LAST);

        web_custom_request("js-endpoint.xsp_3",
                "URL=http://10.100.0.2/crm/services/js-endpoint.xsp",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/xml",
                "Referer=http://10.100.0.2/crm/",
                "Snapshot=t5.inf",
                "Mode=HTML",
                "EncType=",
                "Body=<request><variables><var id='session-id'>571331d9-f944-4854-836d-04ee33b71a84</var><var id='language-id'>en</var></variables><events><event id='591629767192138240' name='getitems'></event></events></request>",
                LAST);

        web_custom_request("js-endpoint.xsp_4",
                "URL=http://10.100.0.2/crm/services/js-endpoint.xsp",
                "Method=POST",
                "Resource=0",
                "RecContentType=text/xml",
                "Referer=http://10.100.0.2/crm/",
                "Snapshot=t6.inf",
                "Mode=HTML",
                "EncType=",
                "Body=<request><variables><var id='session-id'>571331d9-f944-4854-836d-04ee33b71a84</var><var id='language-id'>en</var></variables><events><event id='591629767192138256' name='getitems'></event></events></request>",
                LAST);

        return 0;
}
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
 楼主| 发表于 2010-12-18 09:00:10 | 只看该作者
自己顶,坐等!
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2010-12-18 13:28:52 | 只看该作者
哪位有办法啊....
回复 支持 反对

使用道具 举报

该用户从未签到

4#
 楼主| 发表于 2010-12-18 13:34:29 | 只看该作者
好冷清啊.....
回复 支持 反对

使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

    5#
    发表于 2010-12-18 17:57:19 | 只看该作者
    为啥一定要用自动关联哦,手工操作不就行了
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    6#
    发表于 2010-12-18 19:03:08 | 只看该作者
    调整下左右边界就好了,
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    7#
     楼主| 发表于 2010-12-19 13:47:00 | 只看该作者
    回复 5# msnshow

    请你好好看看帖子,写了手动关联的问题.拜托给点有价值的意见.谢谢

        2:手动关联,尝试在“web_custom_request("js-endpoint.xsp",”前加代码

            web_reg_save_param("sessionID",
                    "LB='session-id'>",
                    "RB=<",
                    "Search=Body",
                    LAST);

    返回错误信息:
    Action.c(76): Error -26377: No match found for the requested parameter "sessionID". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size          [MsgId: MERR-26377]
    Action.c(76): web_custom_request("js-endpoint.xsp") highest severity level was "ERROR", 73942 body bytes, 156 header bytes, 69 chunking overhead bytes          [MsgId: MMSG-26387]
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    8#
     楼主| 发表于 2010-12-19 13:48:28 | 只看该作者
    回复 6# C组十三


        能说具体点吗?
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    9#
    发表于 2010-12-20 10:37:58 | 只看该作者
    关联的内容是不是在head中,把"Search=body"改为"search=all",
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    10#
    发表于 2010-12-20 14:18:56 | 只看该作者
    本帖最后由 Sylvanas 于 2010-12-20 14:20 编辑

    1 查看提取服务器返回值的边界是否错误,日志写的错误很大原因是边界错误。
    注:特殊符号如(")需要转译为(\")
    2 需要在web_custom_request提交请求前加HTTP标头,否则提交请求和服务器无法处理并传回返回值导致无法提取服务器返回值。
    3 另外一种很小的可能是if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size
    希望对你有帮助!
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

    11#
    发表于 2010-12-21 14:09:40 | 只看该作者
    回复 7# xingrenjia12312


        没找到要关联的内容
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-10-5 01:26 , Processed in 0.110077 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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