51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 2231|回复: 5
打印 上一主题 下一主题

[原创] 怎样让脚本保留中文:搜索的时候输入关键字是中文

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-5-24 20:22:11 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
我再对搜索功能进行压力测试的时候,关键字用了中文,但是在脚本中找不到,没有办法进行参数化,请问要怎样设置才可以保持中文的形式?
谢谢
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2010-5-24 21:50:12 | 只看该作者
怎么会找不到呢?把代码贴出来看看

可以考虑使用lr_convert_string_encoding函数转换字符串编码格式
回复 支持 反对

使用道具 举报

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

    连续签到: 1 天

    [LV.7]测试师长

    3#
    发表于 2010-5-24 22:30:57 | 只看该作者
    编码问题吧
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2017-12-2 00:26
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    4#
    发表于 2010-5-25 11:18:05 | 只看该作者
    不如贴下脚本看看,便于分析。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    5#
     楼主| 发表于 2010-5-25 21:55:16 | 只看该作者
    web_submit_data("hotSearchInfo.action",
                    "Action=http://www.drm.stu.edu.cn/webstore/hotSearchInfo.action",
                    "Method=POST",
                    "RecContentType=application/json",
                    "Referer=http://www.drm.stu.edu.cn/webstore/",
                    "Snapshot=t78.inf",
                    "Mode=HTTP",
                    ITEMDATA,
                    "Name=topNumber", "Value=7", ENDITEM,
                    LAST);

            web_concurrent_start(NULL);

            web_url("announce.png",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/images/announce.png",
                    "Resource=1",
                    "RecContentType=image/png",
                    "Referer=http://www.drm.stu.edu.cn/webstore/",
                    "Snapshot=t79.inf",
                    LAST);

            web_url("login.gif",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/images/login.gif",
                    "Resource=1",
                    "RecContentType=image/gif",
                    "Referer=http://www.drm.stu.edu.cn/webstore/",
                    "Snapshot=t80.inf",
                    LAST);

            lr_think_time(5);

            web_url("searchRequest.action",
                    "URL=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Resource=0",
                    "RecContentType=text/html",
                    "Referer=http://www.drm.stu.edu.cn/webstore/",
                    "Snapshot=t84.inf",
                    "Mode=HTTP",
                    LAST);

            web_concurrent_start(NULL);

            web_url("findGoods.css",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/search/css/findGoods.css",
                    "Resource=1",
                    "RecContentType=text/css",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t85.inf",
                    LAST);

            web_url("head.css",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/css/head.css",
                    "Resource=1",
                    "RecContentType=text/css",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t86.inf",
                    LAST);

            web_url("jquery.pagination.js",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/jpage/jquery.pagination.js",
                    "Resource=1",
                    "RecContentType=text/javascript",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t87.inf",
                    LAST);

            web_url("pagination.css",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/jpage/pagination.css",
                    "Resource=1",
                    "RecContentType=text/css",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t88.inf",
                    LAST);

            web_url("goodsLeft.css",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/css/goodsLeft.css",
                    "Resource=1",
                    "RecContentType=text/css",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t89.inf",
                    LAST);

            web_url("shu4.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/upload/AdImg/shu4.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t90.inf",
                    LAST);

            web_url("shu2.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/upload/AdImg/shu2.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t92.inf",
                    LAST);

            web_url("leftSearch.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/images/leftSearch.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t93.inf",
                    LAST);

            web_url("shopping.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/images/shopping.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t94.inf",
                    LAST);

            web_url("question.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/images/question.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t95.inf",
                    LAST);

            web_concurrent_end(NULL);

            web_url("street-title.gif",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/images/street-title.gif",
                    "Resource=1",
                    "RecContentType=image/gif",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t91.inf",
                    LAST);

            web_url("444.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/search/images/444.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t96.inf",
                    LAST);

            web_submit_data("hotSearchInfo.action_2",
                    "Action=http://www.drm.stu.edu.cn/webstore/hotSearchInfo.action",
                    "Method=POST",
                    "RecContentType=application/json",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t97.inf",
                    "Mode=HTTP",
                    ITEMDATA,
                    "Name=topNumber", "Value=7", ENDITEM,
                    LAST);

            web_custom_request("getUserName.action_2",
                    "URL=http://www.drm.stu.edu.cn/webstore/getUserName.action",
                    "Method=POST",
                    "Resource=1",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t98.inf",
                    "EncType=",
                    LAST);

           
            web_url("findStore.css",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/search/css/findStore.css",
                    "Resource=1",
                    "RecContentType=text/css",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=2&q=%E6%88%91%E7%9A%84%E5%B0%8F%E5%BA%97&submit.x=19&submit.y=11",
                    "Snapshot=t103.inf",
                    LAST);

            web_url("storeLeft.css",
                    "URL=http://www.drm.stu.edu.cn/webstore/include/index/css/storeLeft.css",
                    "Resource=1",
                    "RecContentType=text/css",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=2&q=%E6%88%91%E7%9A%84%E5%B0%8F%E5%BA%97&submit.x=19&submit.y=11",
                    "Snapshot=t104.inf",
                    LAST);

            web_url("shu1.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/upload/AdImg/shu1.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=2&q=%E6%88%91%E7%9A%84%E5%B0%8F%E5%BA%97&submit.x=19&submit.y=11",
                    "Snapshot=t105.inf",
                    LAST);

            web_concurrent_end(NULL);

            web_custom_request("getUserName.action_3",
                    "URL=http://www.drm.stu.edu.cn/webstore/getUserName.action",
                    "Method=POST",
                    "Resource=1",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=2&q=%E6%88%91%E7%9A%84%E5%B0%8F%E5%BA%97&submit.x=19&submit.y=11",
                    "Snapshot=t106.inf",
                    "EncType=",
                    LAST);

            web_url("1271596801906.jpg",
                    "URL=http://www.drm.stu.edu.cn/webstore/upload/store/1271596801906.jpg",
                    "Resource=1",
                    "RecContentType=image/jpeg",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=2&q=%E6%88%91%E7%9A%84%E5%B0%8F%E5%BA%97&submit.x=19&submit.y=11",
                    "Snapshot=t107.inf",
                    LAST);

            web_submit_data("hotSearchInfo.action_3",
                    "Action=http://www.drm.stu.edu.cn/webstore/hotSearchInfo.action",
                    "Method=POST",
                    "RecContentType=application/json",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=2&q=%E6%88%91%E7%9A%84%E5%B0%8F%E5%BA%97&submit.x=19&submit.y=11",
                    "Snapshot=t108.inf",
                    "Mode=HTTP",
                    ITEMDATA,
                    "Name=topNumber", "Value=7", ENDITEM,
                    LAST);

    [ 本帖最后由 efficient 于 2010-5-25 21:57 编辑 ]
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    6#
     楼主| 发表于 2010-5-25 21:56:57 | 只看该作者
    web_submit_data("hotSearchInfo.action_2",
                    "Action=http://www.drm.stu.edu.cn/webstore/hotSearchInfo.action",
                    "Method=POST",
                    "RecContentType=application/json",
                    "Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
                    "Snapshot=t97.inf",
                    "Mode=HTTP",
                    ITEMDATA,
                    "Name=topNumber", "Value=7", ENDITEM,
                    LAST);
    中的"Referer=http://www.drm.stu.edu.cn/webstore/searchRequest.action?searchType=1&q=%E6%95%99%E7%88%B6&submit.x=29&submit.y=17",
    这里的q=%E6%95%99%E7%88%B6 应该是我要搜索的内容,我搜索的是中文,但是被翻译成了这种码。如果我要参数化搜索内容 ,改怎么设置?
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-5-12 14:53 , Processed in 0.077867 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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