lr_save_string后无法用lr_eval_string取出参数的值
各位大大,小弟压测时遇到一个问题,lr_save_string后无法用lr_eval_string取出参数的值,请问该如何才能取出参数{ParamTest1}的值,并打印在日志中。脚本如下:
Action()
{
lr_start_transaction("Test");
lr_think_time(2);
lr_save_string("hello world","{ParamTest1}");
lr_log_message("~~~~~~~~~~~~~ Begin ~~~~~~~~~~~~~");
lr_log_message("The value of {ParamTest1} is: %s ! ",lr_eval_string("{ParamTest1}"));
lr_log_message("~~~~~~~~~~~~~ End ~~~~~~~~~~~~~");
lr_end_transaction("Test",LR_AUTO);
return 0;
}
运行结果如下:
Starting action Action.
Action.c(12): Notify: Transaction "Test" started.
Action.c(13): lr_think_time: 2.00 seconds.
Action.c(14): Notify: Saving Parameter "{ParamTest1} = hello world".
~~~~~~~~~~~~~ Begin ~~~~~~~~~~~~~
The value of {ParamTest1} is: {ParamTest1} !
~~~~~~~~~~~~~ End ~~~~~~~~~~~~~
Action.c(18): Notify: Transaction "Test" ended with "Pass" status (Duration: 2.0004 Think Time: 1.9997).
Ending action Action.
Ending iteration 1.
Starting iteration 2.
Notify: Next row for parameter ParamTest = 2 .
Notify: Getting new value for parameter 'ParamTest': table = 'ParamTest.dat' column = '0' row = '2'.
Notify: Next row for parameter ParamTest1 = 1 .
Notify: Getting new value for parameter 'ParamTest1': table = 'ParamTest1.dat' column = '0' row = '1'.
Starting action Action.
Action.c(12): Notify: Transaction "Test" started.
Action.c(13): lr_think_time: 2.00 seconds.
Action.c(14): Notify: Saving Parameter "{ParamTest1} = hello world".
~~~~~~~~~~~~~ Begin ~~~~~~~~~~~~~
The value of {ParamTest1} is: {ParamTest1} !
~~~~~~~~~~~~~ End ~~~~~~~~~~~~~
Action.c(18): Notify: Transaction "Test" ended with "Pass" status (Duration: 2.0009 Think Time: 2.0006).
哪位大神给帮忙看下啊,多谢了!
页:
[1]