A drop of performance testing- manual correlation

How to manually  do correlation?  I  will provide a sample to discuss this with net friends. Use web tours (loadrunner) as B/S application to demo this point.

 

Step1:    just emulate scenario about log on in and log out these two basic steps. Before doing record action. We should set web session enabled.

 

Fig1:

 

Step 2: record the above business rules two times. We will get two scripts and to check them the difference.

 

Script1

    Action()

{

 

                web_url("WebTours",

                                "URL=http://127.0.0.1:1080/WebTours/",

                                "Resource=0",

                                "RecContentType=text/html",

                                "Referer=",

                                "Snapshot=t4.inf",

                                "Mode=HTML",

                                EXTRARES,

                                "Url=../favicon.ico", "Referer=", ENDITEM,

                                LAST);

 

                web_submit_data("login.pl",

                                "Action=http://127.0.0.1:1080/WebTours/login.pl",

                                "Method=POST",

                                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",

                                "Mode=HTML",

                                ITEMDATA,

                                "Name=userSession", "Value=112615.280680437fHQcztipfDtHffpiQV", ENDITEM,

                                "Name=username", "Value=test1", ENDITEM,

                                "Name=password", "Value=1", ENDITEM,

                                "Name=JSFormSubmit", "Value=on", ENDITEM,

                                LAST);

 

                web_submit_data("login.pl_2",

                                "Action=http://127.0.0.1:1080/WebTours/login.pl",

                                "Method=POST",

                                "RecContentType=text/html",

                                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",

                                "Snapshot=t5.inf",

                                "Mode=HTML",

                                ITEMDATA,

                                "Name=userSession", "Value=112615.280680437fHQcztipfDtHffpiQV", ENDITEM,

                                "Name=username", "Value=test1", ENDITEM,

                                "Name=password", "Value=1", ENDITEM,

                                "Name=JSFormSubmit", "Value=on", ENDITEM,

                                "Name=login.x", "Value=62", ENDITEM,

                                "Name=login.y", "Value=6", ENDITEM,

                                LAST);

 

                web_image("SignOff Button",

                                "Alt=SignOff Button",

                                "Snapshot=t6.inf",

                                LAST);

 

                return 0;

}

 

Script 2:

    Action()

{

 

                web_url("WebTours",

                                "URL=http://127.0.0.1:1080/WebTours/",

                                "Resource=0",

                                "RecContentType=text/html",

                                "Referer=",

                                "Snapshot=t1.inf",

                                "Mode=HTML",

                                LAST);

 

                web_url("favicon.ico",

                                "URL=http://127.0.0.1:1080/favicon.ico",

                                "Resource=1",

                                "Referer=",

                                LAST);

 

                web_submit_data("login.pl",

                                "Action=http://127.0.0.1:1080/WebTours/login.pl",

                                "Method=POST",

                                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",

                                "Mode=HTML",

                                ITEMDATA,

                                "Name=userSession", "Value=112615.286593763fHQcztipiAtVzzzHDtHffpiQcicf", ENDITEM,

                                "Name=username", "Value=test1", ENDITEM,

                                "Name=password", "Value=1", ENDITEM,

                                "Name=JSFormSubmit", "Value=on", ENDITEM,

                                LAST);

 

                web_submit_data("login.pl_2",

                                "Action=http://127.0.0.1:1080/WebTours/login.pl",

                                "Method=POST",

                                "RecContentType=text/html",

                                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",

                                "Snapshot=t2.inf",

                                "Mode=HTML",

                                ITEMDATA,

                                "Name=userSession", "Value=112615.286593763fHQcztipiAtVzzzHDtHffpiQcicf", ENDITEM,

                                "Name=username", "Value=test1", ENDITEM,

                                "Name=password", "Value=1", ENDITEM,

                                "Name=JSFormSubmit", "Value=on", ENDITEM,

                                "Name=login.x", "Value=62", ENDITEM,

                                "Name=login.y", "Value=6", ENDITEM,

                                LAST);

 

                web_image("SignOff Button",

                                "Alt=SignOff Button",

                                "Snapshot=t3.inf",

                                LAST);

 

                return 0;

}

 

About how to check the difference we can use the built-in tools in Loadrunner(Tool->Compare with scripts…), then If we find the difference ,we could ignore some elements such as position x,y and snapshot value. What should we focus on is about session info and some others.

 

Step 3 :

     To find the left/right  boundary , then complete the web_reg_save_param_ex function at the right positions.

 

Fig2:

 

Step 4:[in this step, we should know the function web_reg_save_param_ex postion, when we put the function in a wrong position , we cannot get the result as expected.]

   We can complete the scripts which can reply successfully.below is the scripts:

     Action()

{

 

    web_reg_save_param_ex(

                                "ParamName=loginSession",

                                "LB=userSession value=",

                               

                                "RB=>",

                    SEARCH_FILTERS,

                                LAST);

 

                web_url("WebTours",

                                "URL=http://127.0.0.1:1080/WebTours/",

                                "Resource=0",

                                "RecContentType=text/html",

                                "Referer=",

                                "Snapshot=t1.inf",

                                "Mode=HTML",

                                LAST);

 

                web_url("favicon.ico",

                                "URL=http://127.0.0.1:1080/favicon.ico",

                                "Resource=1",

                                "Referer=",

                                LAST);

 

               

               

 

 

                lr_output_message(lr_eval_string("{loginSession}"));

               

                web_submit_data("login.pl",

                                "Action=http://127.0.0.1:1080/WebTours/login.pl",

                                "Method=POST",

                                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",

                                "Mode=HTML",

                                ITEMDATA,

                                "Name=userSession", "Value={loginSession}", ENDITEM,

                                "Name=username", "Value=test1", ENDITEM,

                                "Name=password", "Value=1", ENDITEM,

                                "Name=JSFormSubmit", "Value=on", ENDITEM,

                                LAST);

               

 

                web_submit_data("login.pl_2",

                                "Action=http://127.0.0.1:1080/WebTours/login.pl",

                                "Method=POST",

                                "RecContentType=text/html",

                                "Referer=http://127.0.0.1:1080/WebTours/nav.pl?in=home",

                                "Snapshot=t2.inf",

                                "Mode=HTML",

                                ITEMDATA,

                                "Name=userSession", "Value={loginSession}", ENDITEM,

                                "Name=username", "Value=test1", ENDITEM,

                                "Name=password", "Value=1", ENDITEM,

                                "Name=JSFormSubmit", "Value=on", ENDITEM,

                                "Name=login.x", "Value=62", ENDITEM,

                                "Name=login.y", "Value=6", ENDITEM,

                                LAST);

                               

 

                web_image("SignOff Button",

                                "Alt=SignOff Button",

                                "Snapshot=t3.inf",

                                LAST);

 

                return 0;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值