1: Set LoadRunner Run-time Settings:
Additional attributes set as below:
2: get attrib:
Action()
{
lr_output_message( lr_get_attrib_string("test"));
if ((lr_get_attrib_string("test")) == lr_get_attrib_string(lr_eval_string("8"))) {
lr_output_message("value is pass");
}
else
{
lr_output_message("value is failed");
}
return 0;
}
as same "strcmp"function:
Action()
if( strcmp(lr_get_attrib_string("test"),"8") == 0){
lr_output_message("value is pass");
}
else
{
lr_output_message("value is failed");
}
return 0;
}
3:output message:
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(3): Additional attributes test
Action.c(11): value is failed
Ending action Action.
Starting action Action2.
Ending action Action2.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(22): value is failed
Ending action Action.
Starting action Action2.
Ending action Action2.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
4:advice:
we can use this function determine the conditions!