Loadrunner中参数化

上一篇 / 下一篇  2017-03-15 11:39:06 / 个人分类:个人总结

前提条件:1.有参数NewParam,其中包含temp1——temp88个参数

 2.RunLogic设置为9

执行脚本:

Action()

{

    int i;

    for(i=0;i<5;i++){

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

    }

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

 return 0;

}

情况一:Sequential顺序取值+Each iteration每次迭代更新

脚本执行结果:

Starting iteration 1.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 1.

Starting iteration 2.

Starting action Action.

Action.c(5): temp2

Action.c(5): temp2

Action.c(5): temp2

Action.c(5): temp2

Action.c(5): temp2

Action.c(7): temp2

Ending action Action.

Ending iteration 2.

Starting iteration 3.

Starting action Action.

Action.c(5): temp3

Action.c(5): temp3

Action.c(5): temp3

Action.c(5): temp3

Action.c(5): temp3

Action.c(7): temp3

Ending action Action.

Ending iteration 3.

Starting iteration 4.

Starting action Action.

Action.c(5): temp4

Action.c(5): temp4

Action.c(5): temp4

Action.c(5): temp4

Action.c(5): temp4

Action.c(7): temp4

Ending action Action.

Ending iteration 4.

Starting iteration 5.

Starting action Action.

Action.c(5): temp5

Action.c(5): temp5

Action.c(5): temp5

Action.c(5): temp5

Action.c(5): temp5

Action.c(7): temp5

Ending action Action.

Ending iteration 5.

Starting iteration 6.

Starting action Action.

Action.c(5): temp6

Action.c(5): temp6

Action.c(5): temp6

Action.c(5): temp6

Action.c(5): temp6

Action.c(7): temp6

Ending action Action.

Ending iteration 6.

Starting iteration 7.

Starting action Action.

Action.c(5): temp7

Action.c(5): temp7

Action.c(5): temp7

Action.c(5): temp7

Action.c(5): temp7

Action.c(7): temp7

Ending action Action.

Ending iteration 7.

Starting iteration 8.

Starting action Action.

Action.c(5): temp8

Action.c(5): temp8

Action.c(5): temp8

Action.c(5): temp8

Action.c(5): temp8

Action.c(7): temp8

Ending action Action.

Ending iteration 8.

Starting iteration 9.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 9.

Ending Vuser...

Starting action vuser_end.

Ending action vuser_end.

Vuser Terminated.

 

情况二:Sequential顺序取值+Each occurrence每次取值更新

脚本执行结果:

Starting iteration 1.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp2

Action.c(5): temp3

Action.c(5): temp4

Action.c(5): temp5

Action.c(7): temp6

Ending action Action.

Ending iteration 1.

Starting iteration 2.

Starting action Action.

Action.c(5): temp7

Action.c(5): temp8

Action.c(5): temp1

Action.c(5): temp2

Action.c(5): temp3

Action.c(7): temp4

Ending action Action.

Ending iteration 2.

Starting iteration 3.

Starting action Action.

Action.c(5): temp5

Action.c(5): temp6

Action.c(5): temp7

Action.c(5): temp8

Action.c(5): temp1

Action.c(7): temp2

Ending action Action.

Ending iteration 3.

Starting iteration 4.

Starting action Action.

Action.c(5): temp3

Action.c(5): temp4

Action.c(5): temp5

Action.c(5): temp6

Action.c(5): temp7

Action.c(7): temp8

Ending action Action.

Ending iteration 4.

Starting iteration 5.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp2

Action.c(5): temp3

Action.c(5): temp4

Action.c(5): temp5

Action.c(7): temp6

Ending action Action.

Ending iteration 5.

Starting iteration 6.

Starting action Action.

Action.c(5): temp7

Action.c(5): temp8

Action.c(5): temp1

Action.c(5): temp2

Action.c(5): temp3

Action.c(7): temp4

Ending action Action.

Ending iteration 6.

Starting iteration 7.

Starting action Action.

Action.c(5): temp5

Action.c(5): temp6

Action.c(5): temp7

Action.c(5): temp8

Action.c(5): temp1

Action.c(7): temp2

Ending action Action.

Ending iteration 7.

Starting iteration 8.

Starting action Action.

Action.c(5): temp3

Action.c(5): temp4

Action.c(5): temp5

Action.c(5): temp6

Action.c(5): temp7

Action.c(7): temp8

Ending action Action.

Ending iteration 8.

Starting iteration 9.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp2

Action.c(5): temp3

Action.c(5): temp4

Action.c(5): temp5

Action.c(7): temp6

Ending action Action.

Ending iteration 9.

Ending Vuser...

Starting action vuser_end.

Ending action vuser_end.

Vuser Terminated.

情况三:Sequential顺序取值+Once只更新一次

脚本执行结果:

tarting iteration 1.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 1.

Starting iteration 2.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 2.

Starting iteration 3.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 3.

Starting iteration 4.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 4.

Starting iteration 5.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 5.

Starting iteration 6.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 6.

Starting iteration 7.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 7.

Starting iteration 8.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 8.

Starting iteration 9.

Starting action Action.

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(5): temp1

Action.c(7): temp1

Ending action Action.

Ending iteration 9.

Ending Vuser...

Starting action vuser_end.

Ending action vuser_end.

Vuser Terminated.

Sequential取值下的各种情况

说明: http://img.blog.csdn.net/20130901133845890?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemduc2ps/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

Random取值

顺序取值的各种方法搞明白后,Random取值(随机取值)就比较简单了,随机取值可以实现在参数列表中随机选择一条记录,将parameters这个参数的Select next row取值方法从sequential改为Random

Select next row下的Random选项是,参数化的取值情况如下表说明: http://img.blog.csdn.net/20130901135050468?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemduc2ps/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

 选择Select next row下的Unique选项是,参数化取值情况如下表

说明: http://img.blog.csdn.net/20130901140239750?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvemduc2ps/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast

 

 

 

 


TAG:

 

评分:0

我来说两句

日历

« 2024-03-27  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 7862
  • 日志数: 9
  • 建立时间: 2016-08-05
  • 更新时间: 2017-03-28

RSS订阅

Open Toolbar