LoadRunner script writes script output log to external file, analysis parameter value methodCategory: Experience loadrunner my test 2012-04-01 12:52 2340 people read reviews (0) Favorites report Script Loadrunnerstreamfilestring Test
, you cannot view the output log when you run the script in the controller, you can write the code output log to the external file manually and get the relevant information by looking at the log:
The following script is intended to analyze how a multi-user run-time parameter list in a scene is valued (Id,groupid,sid,uname), and whether to implement concurrency by viewing the point in time after setting the collection point
int id,scid;//defines 2 shaping variables that hold vuser information
Char *group;//definition Save groupname
Char *filename = "c:\\work.log";//manually create a stored log file
Long File_stream;
if (File_stream = fopen (filename, "A +")) = = NULL)//Open File
{
Lr_error_message ("Cannot open%s", filename);
return-1;
}
Lr_whoami (&ID,&GROUP,&SCID);//Get variable
Lr_save_datetime ("%h:%m:%s", Date_now + Time_now, "times");//Get current time and determine user logon time
if (ID > 0)
{
fprintf (File_stream, "VUser User information: time=%s,id=%d,group=%s,scid=%d,uname=%s\n", lr_eval_string ("{Times}"), Id,group, Scid,lr_eval_string ("{uname}");
}
Fclose (File_stream);
Because the test system restricts only one person to log on per account, there is a lot of error information when it is run in the scene after parameterization. By outputting log above, the test is the result of the parameterized value method.
Parameterization: User 1, User 2, User 3, User 4, user 5, User 6, user 7, user 8, User 9, User 10, Value update mode set to Sequence+iteration or unique+iteration
Controller: Set number of users to 5, loop 2 times
Verify the parameterized result of the value method:
Sequence mode, 5 users The first time the value is User 1, user 1, User 1, User 1, User 1, the second value is User 2, user 2, User 2, User 2, User 2
The unique way is that 5 users the first time the value is User 1, user 2, User 3, User 4, User 5, the second value is User 6, user 7, user 8, User 9, user 10
Therefore, if you restrict each account to allow only one person to log in (that is, do not allow multiple people to log in with an account), this must be set unique+iteration, so the problem to find the answer to solve.
LoadRunner script writes script output log to external file, analysis parameter value method