51Testing软件测试论坛

标题: 关于录制脚本的问题 [打印本页]

作者: luyanyan1985    时间: 2010-5-21 13:08
标题: 关于录制脚本的问题
各位:
   我在两台机器上装了loadrunner9.5的版本,然后对同一个地址录制脚本,录制完成后发现两个脚本不同,A脚本如下:
        lr_start_transaction("点击登录、");

        web_submit_data("Login.aspx_2",
                "Action=http://192.168.0.8/TestIBM4/Login.aspx",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/Login.aspx",
                "Snapshot=t3.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__VIEWSTATE", "Value=/wEPDwUKLTUwMjk2MDk5MmQYAQUMdmFsaWRhdGVDb2RlDw9kBSQ1YTU1ODliMS1jY2EzLTRmYzYtODQxZS1iN2ViYTZlMWM1NTVkx4m/feP2Y5qSUeLFNgVf8q32ANw=", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWBQK674WVBgLcgpeMBwLGmdGVDAKMhs7EAgKfwImNCywL3iF4Uc1oSNpVFtEFseHfSbY3", ENDITEM,
                "Name=user", "Value={NewParam}", ENDITEM,
                "Name=pwd", "Value=qwe123", ENDITEM,
                "Name=validate", "Value=", ENDITEM,
                "Name=ctl02", "Value=鐧诲綍", ENDITEM,
                "Name=screenHeight", "Value=930", ENDITEM,
                "Name=clientHeight", "Value=759", ENDITEM,
                EXTRARES,
                "Url=images/bottom_mid.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_left.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_right.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/serviceonline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/hometopbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/exit_off.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_bottombg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/hometopimg.jpg", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/positionBack.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_leftline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/grouptitlebg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_offbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_linked.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/leftmenubg_on.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/arrow1.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/leftmenuitembg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                LAST);

        web_url("MainPage.aspx",
                "URL=http://192.168.0.8/TestIBM4/MainPage.aspx",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t6.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=images/work_input.gif", ENDITEM,
                "Url=images/ico_avigation.png", ENDITEM,
                "Url=images/sidebartop_bg.gif", ENDITEM,
                "Url=images/mytaskbg_left.gif", ENDITEM,
                "Url=images/mytaskbg_right.gif", ENDITEM,
                "Url=images/img_Consultant.gif", ENDITEM,
                "Url=images/icon_edit.gif", ENDITEM,
                "Url=images/img_OnlineService.gif", ENDITEM,
                "Url=images/subtab.gif", ENDITEM,
                "Url=images/tab_button.gif", ENDITEM,
                "Url=images/newDot.gif", ENDITEM,
                "Url=images/more.gif", ENDITEM,
                "Url=images/search_img.gif", ENDITEM,
                LAST);

        lr_end_transaction("点击登录、",LR_AUTO);

B脚本如下:
        lr_start_transaction("点击登录");

        web_submit_data("Login.aspx_2",
                "Action=http://192.168.0.8/TestIBM4/Login.aspx",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/Login.aspx",
                "Snapshot=t3.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__VIEWSTATE", "Value=/wEPDwUKLTUwMjk2MDk5MmQYAQUMdmFsaWRhdGVDb2RlDw9kBSRjMjQyMmJiMS02MGViLTRiYjYtOThmYS02OWFhMWQ2Y2ZiMTZkQzPZqoKxux8Xhr3j/4aK3MBwY0M=", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWBQKsnb7vCwLcgpeMBwLGmdGVDAKMhs7EAgKfwImNC3/dIUsMtyU0zMGNbkU3BpyW4TQJ", ENDITEM,
                "Name=user", "Value=test00001", ENDITEM,
                "Name=pwd", "Value=qwe123", ENDITEM,
                "Name=validate", "Value=", ENDITEM,
                "Name=ctl02", "Value=鐧诲綍", ENDITEM,
                "Name=screenHeight", "Value=930", ENDITEM,
                "Name=clientHeight", "Value=782", ENDITEM,
                LAST);


        web_submit_data("Login.aspx_3",
                "Action=http://192.168.0.8/TestIBM4/Login.aspx",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/Login.aspx",
                "Snapshot=t4.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__VIEWSTATE", "Value=/wEPDwUKLTUwMjk2MDk5MmQYAQUMdmFsaWRhdGVDb2RlDw9kBSRjMjQyMmJiMS02MGViLTRiYjYtOThmYS02OWFhMWQ2Y2ZiMTZkQzPZqoKxux8Xhr3j/4aK3MBwY0M=", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWBQKsnb7vCwLcgpeMBwLGmdGVDAKMhs7EAgKfwImNC3/dIUsMtyU0zMGNbkU3BpyW4TQJ", ENDITEM,
                "Name=user", "Value=test00001", ENDITEM,
                "Name=pwd", "Value=qwe123", ENDITEM,
                "Name=validate", "Value=", ENDITEM,
                "Name=ctl02", "Value=鐧诲綍", ENDITEM,
                "Name=screenHeight", "Value=930", ENDITEM,
                "Name=clientHeight", "Value=782", ENDITEM,
                EXTRARES,
                "Url=images/hometopbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_mid.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_right.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_left.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/serviceonline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/hometopimg.jpg", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/exit_off.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_bottombg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/positionBack.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_leftline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_offbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_linked.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/grouptitlebg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/leftmenubg_on.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                LAST);

                web_url("MainPage.aspx",
                "URL=http://192.168.0.8/TestIBM4/MainPage.aspx",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t10.inf",
                "Mode=HTML",
                LAST);

        web_url("全球最理想雇主50强出炉 11-6",
                "URL=http://192.168.0.8/TestIBM4/MainPage.aspx",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t11.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=images/ico_avigation.png", ENDITEM,
                "Url=images/sidebartop_bg.gif", ENDITEM,
                "Url=images/icon_edit.gif", ENDITEM,
                "Url=images/img_Consultant.gif", ENDITEM,
                "Url=images/img_OnlineService.gif", ENDITEM,
                "Url=images/mytaskbg_left.gif", ENDITEM,
                "Url=images/mytaskbg_right.gif", ENDITEM,
                "Url=images/subtab.gif", ENDITEM,
                "Url=images/tab_button.gif", ENDITEM,
                "Url=images/work_input.gif", ENDITEM,
                "Url=images/search_img.gif", ENDITEM,
                "Url=images/more.gif", ENDITEM,
                "Url=images/newDot.gif", ENDITEM,
                LAST);

        lr_end_transaction("点击登录",LR_AUTO);

疑问:为什么在B脚本中会联系出现两个相同的web_submit_date呢?还有B脚本中还多了绿色的那部分代码?谢谢~~
作者: msnshow    时间: 2010-5-21 13:11
楼主你要先确认两次的操作是否完全一样,从脚本看肯定是操作有所不同引起的
作者: luyanyan1985    时间: 2010-5-21 13:18
做的是一样的操作,可就是不明白为什么录制出来的脚本是不一样的。A脚本详细:       
lr_start_transaction("点击登录、");

        web_submit_data("Login.aspx_2",
                "Action=http://192.168.0.8/TestIBM4/Login.aspx",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/Login.aspx",
                "Snapshot=t3.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__VIEWSTATE", "Value=/wEPDwUKLTUwMjk2MDk5MmQYAQUMdmFsaWRhdGVDb2RlDw9kBSQ1YTU1ODliMS1jY2EzLTRmYzYtODQxZS1iN2ViYTZlMWM1NTVkx4m/feP2Y5qSUeLFNgVf8q32ANw=", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWBQK674WVBgLcgpeMBwLGmdGVDAKMhs7EAgKfwImNCywL3iF4Uc1oSNpVFtEFseHfSbY3", ENDITEM,
                "Name=user", "Value={NewParam}", ENDITEM,
                "Name=pwd", "Value=qwe123", ENDITEM,
                "Name=validate", "Value=", ENDITEM,
                "Name=ctl02", "Value=鐧诲綍", ENDITEM,
                "Name=screenHeight", "Value=930", ENDITEM,
                "Name=clientHeight", "Value=759", ENDITEM,
                EXTRARES,
                "Url=images/bottom_mid.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_left.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_right.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/serviceonline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/hometopbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/exit_off.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_bottombg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/hometopimg.jpg", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/positionBack.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_leftline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/grouptitlebg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_offbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_linked.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/leftmenubg_on.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/arrow1.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/leftmenuitembg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                LAST);

        web_url("blank.html",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t4.inf",
                "Mode=HTML",
                LAST);

        web_url("blank.html_2",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t5.inf",
                "Mode=HTML",
                LAST);

        web_url("MainPage.aspx",
                "URL=http://192.168.0.8/TestIBM4/MainPage.aspx",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t6.inf",
                "Mode=HTML",
                EXTRARES,
作者: luyanyan1985    时间: 2010-5-21 13:19
B脚本如下:
        lr_start_transaction("点击登录");

        web_submit_data("Login.aspx_2",
                "Action=http://192.168.0.8/TestIBM4/Login.aspx",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/Login.aspx",
                "Snapshot=t3.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__VIEWSTATE", "Value=/wEPDwUKLTUwMjk2MDk5MmQYAQUMdmFsaWRhdGVDb2RlDw9kBSRjMjQyMmJiMS02MGViLTRiYjYtOThmYS02OWFhMWQ2Y2ZiMTZkQzPZqoKxux8Xhr3j/4aK3MBwY0M=", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWBQKsnb7vCwLcgpeMBwLGmdGVDAKMhs7EAgKfwImNC3/dIUsMtyU0zMGNbkU3BpyW4TQJ", ENDITEM,
                "Name=user", "Value=test00001", ENDITEM,
                "Name=pwd", "Value=qwe123", ENDITEM,
                "Name=validate", "Value=", ENDITEM,
                "Name=ctl02", "Value=鐧诲綍", ENDITEM,
                "Name=screenHeight", "Value=930", ENDITEM,
                "Name=clientHeight", "Value=782", ENDITEM,
                LAST);

        web_submit_data("Login.aspx_3",
                "Action=http://192.168.0.8/TestIBM4/Login.aspx",
                "Method=POST",
                "TargetFrame=",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/Login.aspx",
                "Snapshot=t4.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=__VIEWSTATE", "Value=/wEPDwUKLTUwMjk2MDk5MmQYAQUMdmFsaWRhdGVDb2RlDw9kBSRjMjQyMmJiMS02MGViLTRiYjYtOThmYS02OWFhMWQ2Y2ZiMTZkQzPZqoKxux8Xhr3j/4aK3MBwY0M=", ENDITEM,
                "Name=__EVENTVALIDATION", "Value=/wEWBQKsnb7vCwLcgpeMBwLGmdGVDAKMhs7EAgKfwImNC3/dIUsMtyU0zMGNbkU3BpyW4TQJ", ENDITEM,
                "Name=user", "Value=test00001", ENDITEM,
                "Name=pwd", "Value=qwe123", ENDITEM,
                "Name=validate", "Value=", ENDITEM,
                "Name=ctl02", "Value=鐧诲綍", ENDITEM,
                "Name=screenHeight", "Value=930", ENDITEM,
                "Name=clientHeight", "Value=782", ENDITEM,
                EXTRARES,
                "Url=images/hometopbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_mid.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_right.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/bottom_left.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/serviceonline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/hometopimg.jpg", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/exit_off.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_bottombg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/positionBack.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menubar_leftline.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_offbg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/menuitem_linked.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/grouptitlebg.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                "Url=images/leftmenubg_on.gif", "Referer=http://192.168.0.8/TestIBM4/home.aspx", ENDITEM,
                LAST);

        web_url("blank.html",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t5.inf",
                "Mode=HTML",
                LAST);

        web_url("blank.html_2",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Mode=HTML",
                LAST);

        web_url("blank.html_3",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t6.inf",
                "Mode=HTML",
                LAST);

        web_url("blank.html_4",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t7.inf",
                "Mode=HTML",
                LAST);

        web_url("blank.html_5",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t8.inf",
                "Mode=HTML",
                LAST);

        web_url("blank.html_6",
                "URL=http://192.168.0.8/TestIBM4/blank.html",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t9.inf",
                "Mode=HTML",
                LAST);

        web_url("MainPage.aspx",
                "URL=http://192.168.0.8/TestIBM4/MainPage.aspx",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t10.inf",
                "Mode=HTML",
                LAST);

        web_url("全球最理想雇主50强出炉 11-6",
                "URL=http://192.168.0.8/TestIBM4/MainPage.aspx",
                "TargetFrame=",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://192.168.0.8/TestIBM4/home.aspx",
                "Snapshot=t11.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=images/ico_avigation.png", ENDITEM,
                "Url=images/sidebartop_bg.gif", ENDITEM,
                "Url=images/icon_edit.gif", ENDITEM,
                "Url=images/img_Consultant.gif", ENDITEM,
                "Url=images/img_OnlineService.gif", ENDITEM,
                "Url=images/mytaskbg_left.gif", ENDITEM,
                "Url=images/mytaskbg_right.gif", ENDITEM,
                "Url=images/subtab.gif", ENDITEM,
                "Url=images/tab_button.gif", ENDITEM,
                "Url=images/work_input.gif", ENDITEM,
                "Url=images/search_img.gif", ENDITEM,
                "Url=images/more.gif", ENDITEM,
                "Url=images/newDot.gif", ENDITEM,
                LAST);

        lr_end_transaction("点击登录",LR_AUTO);
麻烦各位帮忙解决一下这个问题,谢谢~~
作者: luyanyan1985    时间: 2010-5-21 13:52
有没有人帮忙解决一下?
作者: sc_zk2008    时间: 2010-5-21 15:23
先用Windy工具比较下两者吧
作者: linchenqiu    时间: 2010-5-21 15:36
按钮 显示乱码




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2