51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1735|回复: 4
打印 上一主题 下一主题

[求助] 求大神解答!!!将登录脚本剪切到vuser_init后,提示关联内容错误,详见描述

[复制链接]
  • TA的每日心情
    擦汗
    2016-2-17 19:57
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    跳转到指定楼层
    1#
    发表于 2018-5-15 19:26:56 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
    遇到的问题描述:录制后,对脚本做了参数化和关联,代码都在action中是能运行的,将登录的代码剪切到Vuser_init后,提示:No match found for the requested parameter "CorrelationParameter_1"
    业务逻辑概述:用户登录,在列表中选择想要处理的问题,加载问题详细描述,处理问题,提交
    被复制到Vuser_init中的代码
    vuser_init()
    {
    web_url("index.shtml",
      "URL=http://172.16.0.87/pj-web/index.shtml",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t1.inf",
      "Mode=HTML",
      EXTRARES,
      "URL=http://www.bing.com/favicon.ico", ENDITEM,
      "URL=static-cdn/images/pad-title.png", ENDITEM,
      "URL=static-cdn/images/login/banner.jpg", ENDITEM,
      "URL=static-cdn/images/login/caption.png", ENDITEM,
      "URL=static-cdn/images/login/loc-corner.png", ENDITEM,
      "URL=static-cdn/images/login/login-icon.png", ENDITEM,
      "URL=static-cdn/component/jquery/colorbox/1.4.7.1.0/images/close.png", ENDITEM,
      "URL=http://hm.baidu.com/hm.js?ffc208e5163077c4ec683f37ce86b35b", ENDITEM,
      LAST);

    web_submit_form("SystemLogin",
      "Snapshot=t2.inf",
      ITEMDATA,
      "Name=j_username", "Value={username}", ENDITEM,
      "Name=j_password", "Value=1", ENDITEM,
      EXTRARES,
      "URL=static-cdn/images/kf-monkey1.png", "Referer=http://172.16.0.87/pj-web/mark/union/union-list.shtml", ENDITEM,
      "URL=static-cdn/images/icon-help1.gif", "Referer=http://172.16.0.87/pj-web/mark/union/union-list.shtml", ENDITEM,
      "URL=static-cdn/images/pad-arrow.png", "Referer=http://172.16.0.87/pj-web/mark/union/union-list.shtml", ENDITEM,
      "URL=static-cdn/images/pad-code.png", "Referer=http://172.16.0.87/pj-web/mark/union/union-list.shtml", ENDITEM,
      LAST);
    return 0;
    }
    保留在action中的代码
    Action()
    {
    int count1;
    int count2;

      web_url("union-list.shtml",
      "URL=http://172.16.0.87/pj-web/mark/union/union-list.shtml",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0",
      "Snapshot=t5.inf",
      "Mode=HTML",
      LAST);

    //lr_think_time(5);
    for (count1 = 0;count1<2;count1++) {

    //Correlation comment - Do not change!Original value='3895675' Name ='CorrelationParameter_1'

    web_reg_save_param_ex(
      "ParamName=CorrelationParameter_1",
      "LB=studentID\" value=\"",
      "RB=\" ",
      SEARCH_FILTERS,
      "Scope=Body",
      "RequestUrl=*/mark-union.shtml*",
      LAST);

    web_url("mark-union.shtml",
      "URL=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t3.inf",
      "Mode=HTML",
      EXTRARES,
      "URL=/pj-web/static-cdn/images/mark1.png", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0", ENDITEM,
      "URL=/pj-web/r/30663035643433632d643535312d356236332d626136332d3536663065323566343237663a2f756e696f6e5f6e65772f313039342f312f3139332f73747564656e742f333839353637352f63646266303065666566316534366335623439623162383063646461333433312fb2a60abda1a90ec368c0.png?_=0.24283776730976814", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0", ENDITEM,
      "URL=/pj-web/static-cdn/component/jquery/jquery-ui/1.8.24/css/images/resize.png", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0", ENDITEM,
      "URL=/pj-web/static-cdn/images/mark.png", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0", ENDITEM,
      "URL=/pj-web/static-cdn/images/drag.png", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0", ENDITEM,
      "URL=/pj-web/static-cdn/component/jquery/colorbox/1.4.7.1.0/images/load.gif", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0", ENDITEM,
      LAST);

    lr_log_message("studentid,%s",lr_eval_string("{CorrelationParameter_1}"));

    web_submit_data("mark-union!ajaxSubmit.shtml",
      "Action=http://172.16.0.87/pj-web/mark/union/mark-union!ajaxSubmit.shtml",
      "Method=POST",
      "RecContentType=text/plain",
      "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0",
      "Snapshot=t4.inf",
      "Mode=HTML",
      ITEMDATA,
      "Name=timeFlag", "Value=0", ENDITEM,
      "Name=time", "Value=0", ENDITEM,
      "Name=questionID", "Value=179978", ENDITEM,
      "Name=optionIndex", "Value=0", ENDITEM,
      "Name=flag3", "Value=0", ENDITEM,
      "Name=studentID", "Value={CorrelationParameter_1}", ENDITEM,
      "Name=choiceFlag", "Value=0", ENDITEM,
      "Name=sheetID", "Value=4378", ENDITEM,
      "Name=markTeacherType", "Value=1", ENDITEM,
      "Name=tags", "Value=", ENDITEM,
      "Name=score", "Value=2.71", ENDITEM,
      EXTRARES,
      "URL=/pj-web/r/30663035643433632d643535312d356236332d626136332d3536663065323566343237663a2f756e696f6e5f6e65772f313039342f312f3139332f73747564656e742f333839353637362f39616338386366373165383134336666616636323165373738303565666264322fb2a60abda1a90ec368c0.png?_=0.9689678548550878", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0", ENDITEM,
      LAST);

    }

    web_url("union-list.shtml",
      "URL=http://172.16.0.87/pj-web/mark/union/union-list.shtml",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179978&optionIndex=0",
      "Snapshot=t5.inf",
      "Mode=HTML",
      LAST);

    for(count2 = 0;count2<2;count2++){
    //Correlation comment - Do not change!Original value='3895670' Name ='CorrelationParameter_2'

    web_reg_save_param_ex(
      "ParamName=CorrelationParameter_2",
      "LB=studentID\" value=\"",
      "RB=\" ",
      SEARCH_FILTERS,
      "Scope=Body",
      "RequestUrl=*/mark-union.shtml*",
      LAST);

    web_url("mark-union.shtml_2",
      "URL=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179979&optionIndex=0",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t6.inf",
      "Mode=HTML",
      EXTRARES,
      "URL=/pj-web/r/30663035643433632d643535312d356236332d626136332d3536663065323566343237663a2f756e696f6e5f6e65772f313039342f312f3139332f73747564656e742f333839353637302f34323962623766353830636534633333386161343665356466346633313437662fb2a60abda1a90ec368c1.png?_=0.08509155479400904", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179979&optionIndex=0", ENDITEM,
      LAST);

    //lr_think_time(5);

    web_submit_data("mark-union!ajaxSubmit.shtml_2",
      "Action=http://172.16.0.87/pj-web/mark/union/mark-union!ajaxSubmit.shtml",
      "Method=POST",
      "RecContentType=text/plain",
      "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179979&optionIndex=0",
      "Snapshot=t7.inf",
      "Mode=HTML",
      ITEMDATA,
      "Name=timeFlag", "Value=0", ENDITEM,
      "Name=time", "Value=0", ENDITEM,
      "Name=questionID", "Value=179979", ENDITEM,
      "Name=optionIndex", "Value=0", ENDITEM,
      "Name=flag3", "Value=0", ENDITEM,
      "Name=studentID", "Value={CorrelationParameter_2}", ENDITEM,
      "Name=choiceFlag", "Value=0", ENDITEM,
      "Name=sheetID", "Value=4378", ENDITEM,
      "Name=markTeacherType", "Value=1", ENDITEM,
      "Name=tags", "Value=", ENDITEM,
      "Name=score", "Value=2.81", ENDITEM,
      EXTRARES,
      "URL=/pj-web/r/30663035643433632d643535312d356236332d626136332d3536663065323566343237663a2f756e696f6e5f6e65772f313039342f312f3139332f73747564656e742f333839353637312f39333733323533386163316134336333623332623133313664636632356437642fb2a60abda1a90ec368c1.png?_=0.14386377759728208", "Referer=http://172.16.0.87/pj-web/mark/union/mark-union.shtml?questionID=179979&optionIndex=0", ENDITEM,
      LAST);
    lr_log_message("studentid,%s",lr_eval_string("{CorrelationParameter_2}"));
    }

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

    使用道具 举报

  • TA的每日心情
    擦汗
    2016-2-17 19:57
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]测试小兵

    2#
     楼主| 发表于 2018-5-16 08:28:53 | 只看该作者
    防沉,自己顶一下
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2018-5-16 15:22
  • 签到天数: 5 天

    连续签到: 1 天

    [LV.2]测试排长

    3#
    发表于 2018-5-17 13:32:51 | 只看该作者
    查看关联函数是否也在Vuser_init的action里面
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    2019-3-7 09:49
  • 签到天数: 133 天

    连续签到: 1 天

    [LV.7]测试师长

    4#
    发表于 2018-5-22 20:52:52 | 只看该作者
    没找到检查点或者是关联函数,应该是请求有错
    回复 支持 反对

    使用道具 举报

  • TA的每日心情
    奋斗
    3 小时前
  • 签到天数: 1523 天

    连续签到: 2 天

    [LV.Master]测试大本营

    5#
    发表于 2018-6-26 11:58:29 | 只看该作者
    for (count1 = 0;count1<2;count1++) {  
    把for循环去掉,如果想迭代action里面的代码,在runtime-setting里面设置即可。
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-11-26 13:39 , Processed in 0.065763 second(s), 22 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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