Sample Output - One of Many ("G1")
Here is an example of the output generated by the default VBA code:
LandAround()
{
// File H:\Wilsonmarcom\LandAround.c generated 1/25/2005 2:22:42 PM
// by Excel file H:\Wilsonmarcom\lrxls2vu.xls containing 4 rows
// Assuming definition of ptDateTime.
// See http://www.wilsonmar.com/LRXls2VU.htm for updates from this version.
int i, iRecRand, iMixRand;
float floatThinkRand;
long longReturnCode, longBytesReturned, longLastByteMSecs;
char last[30];
lr_continue_on_error(1); // to process all despite an error.
// Save message level from user's Runtime Settings:
iMsg_level=lr_get_debug_message();
sprintf( cMsg_level, "%d", iMsg_level);
lr_save_string( cMsg_level, "pMsg_level" );
floatThinkRand = 0.5;
srand(time(NULL)+rand()%100);
iMixRand = rand()%100;
iRecRand = rand()%3 +1; // to begin from 1.
// Entire section:
if( 20>=iMixRand ){
// In Action for Use Case ManualStep= Priority=1
// From cell $A$2 Run= Parm= MixPct=0
if( 1== iRecRand ){
web_reg_find("Text=Sorry, the page you requested does not exist.",
"ID=1- mercury home", "FAIL=Found",LAST);
web_reg_find("Text=Copyright © 2005 Yahoo! Inc. All rights reserved.",
"ID=1- mercury home", "FAIL=NotFound",LAST);
web_reg_save_param("pHTTPRet","LB=HTTP/1.1 ",
"RB= ","Search=Header","ORD=All","NOTFOUND=Warning",LAST);
lr_start_transaction("1- mercury home");
web_url("1- mercury home",
"URL=http://www.mercury.com",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_end_transaction("1- mercury home", LR_AUTO);
lr_think_time(0.5);
if( atoi(lr_eval_string("{pHTTPRet_count}")) != 0 ){
sprintf(last, "{pHTTPRet_%s}",
lr_eval_string("{pHTTPRet_count}"));
lr_save_string( lr_eval_string(last) ,"pHTTPRet_last");
if( atoi(lr_eval_string("{pHTTPRet_last}")) != 200){
lr_error_message("HTTP %s (last of %s) not the 200 expected for 1- mercury home",
lr_eval_string("{pHTTPRet_last}"),
lr_eval_string("{pHTTPRet_count}"));
} //if
} //if
longReturnCode=web_get_int_property( HTTP_INFO_RETURN_CODE );
longBytesReturned=web_get_int_property( HTTP_INFO_DOWNLOAD_SIZE );
longLastByteMSecs=web_get_int_property( HTTP_INFO_DOWNLOAD_TIME );
// Allow messages (Advanced trace) regardless:
lr_set_debug_message( LR_MSG_CLASS_JIT_LOG_ON_ERROR, LR_SWITCH_OFF);
lr_set_debug_message( 10,LR_MSG_ON );
lr_output_message("%s\t1- mercury home\t TTime=\t%4.2f\t RC=\t%d\t Bytes=\t%d\t MSecs=\t %d",
lr_eval_string("{ptDateTime}"),
floatThinkRand,
longReturnCode,
longBytesReturned,
longLastByteMSecs );
// Reset message level to Runtime Settings:
if( iMsg_level & LR_MSG_CLASS_JIT_LOG_ON_ERROR)
lr_set_debug_message( LR_MSG_CLASS_JIT_LOG_ON_ERROR, LR_SWITCH_ON);
lr_set_debug_message( iMsg_level, LR_MSG_ON);
} //if iRecRand()
// In Action for Use Case ManualStep= Priority=2
// From cell $A$3 Run= Parm= MixPct=0
if( 2== iRecRand ){
web_reg_find("Text=Sorry, the page you requested does not exist.",
"ID=Y2- yahoo group", "FAIL=Found",LAST);
// No Confirm text specified for web_reg_find
web_reg_save_param("pHTTPRet","LB=HTTP/1.1 ",
"RB= ","Search=Header","ORD=All","NOTFOUND=Warning",LAST);
lr_start_transaction("Y2- yahoo group");
web_url("Y2- yahoo group",
"URL=http://groups.yahoo.com/group/LoadRunner/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_end_transaction("Y2- yahoo group", LR_AUTO);
lr_think_time(0.5);
if( atoi(lr_eval_string("{pHTTPRet_count}")) != 0 ){
sprintf(last, "{pHTTPRet_%s}",
lr_eval_string("{pHTTPRet_count}"));
lr_save_string( lr_eval_string(last) ,"pHTTPRet_last");
if( atoi(lr_eval_string("{pHTTPRet_last}")) != 200){
lr_error_message("HTTP %s (last of %s) not the 200 expected for Y2- yahoo group",
lr_eval_string("{pHTTPRet_last}"),
lr_eval_string("{pHTTPRet_count}"));
} //if
} //if
longReturnCode=web_get_int_property( HTTP_INFO_RETURN_CODE );
longBytesReturned=web_get_int_property( HTTP_INFO_DOWNLOAD_SIZE );
longLastByteMSecs=web_get_int_property( HTTP_INFO_DOWNLOAD_TIME );
// Allow messages (Advanced trace) regardless:
lr_set_debug_message( LR_MSG_CLASS_JIT_LOG_ON_ERROR, LR_SWITCH_OFF);
lr_set_debug_message( 10,LR_MSG_ON );
lr_output_message("%s\tY2- yahoo group\t TTime=\t%4.2f\t RC=\t%d\t Bytes=\t%d\t MSecs=\t %d",
lr_eval_string("{ptDateTime}"),
floatThinkRand,
longReturnCode,
longBytesReturned,
longLastByteMSecs );
// Reset message level to Runtime Settings:
if( iMsg_level & LR_MSG_CLASS_JIT_LOG_ON_ERROR)
lr_set_debug_message( LR_MSG_CLASS_JIT_LOG_ON_ERROR, LR_SWITCH_ON);
lr_set_debug_message( iMsg_level, LR_MSG_ON);
} //if iRecRand()
// In Action for Use Case ManualStep= Priority=3
// From cell $A$4 Run= Parm= MixPct=0
// Note: http assumed
if( 3== iRecRand ){
web_reg_find("Text=Sorry, the page you requested does not exist.",
"ID=3- qaforums", "FAIL=Found",LAST);
// No Confirm text specified for web_reg_find
web_reg_save_param("pHTTPRet","LB=HTTP/1.1 ",
"RB= ","Search=Header","ORD=All","NOTFOUND=Warning",LAST);
lr_start_transaction("3- qaforums");
web_url("3- qaforums",
"URL=http://qaforums.com",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Mode=HTML",
LAST);
lr_end_transaction("3- qaforums", LR_AUTO);
lr_think_time(0.5);
if( atoi(lr_eval_string("{pHTTPRet_count}")) != 0 ){
sprintf(last, "{pHTTPRet_%s}",
lr_eval_string("{pHTTPRet_count}"));
lr_save_string( lr_eval_string(last) ,"pHTTPRet_last");
if( atoi(lr_eval_string("{pHTTPRet_last}")) != 200){
lr_error_message("HTTP %s (last of %s) not the 200 expected for 3- qaforums",
lr_eval_string("{pHTTPRet_last}"),
lr_eval_string("{pHTTPRet_count}"));
} //if
} //if
longReturnCode=web_get_int_property( HTTP_INFO_RETURN_CODE );
longBytesReturned=web_get_int_property( HTTP_INFO_DOWNLOAD_SIZE );
longLastByteMSecs=web_get_int_property( HTTP_INFO_DOWNLOAD_TIME );
// Allow messages (Advanced trace) regardless:
lr_set_debug_message( LR_MSG_CLASS_JIT_LOG_ON_ERROR, LR_SWITCH_OFF);
lr_set_debug_message( 10,LR_MSG_ON );
lr_output_message("%s\t3- qaforums\t TTime=\t%4.2f\t RC=\t%d\t Bytes=\t%d\t MSecs=\t %d",
lr_eval_string("{ptDateTime}"),
floatThinkRand,
longReturnCode,
longBytesReturned,
longLastByteMSecs );
// Reset message level to Runtime Settings:
if( iMsg_level & LR_MSG_CLASS_JIT_LOG_ON_ERROR)
lr_set_debug_message( LR_MSG_CLASS_JIT_LOG_ON_ERROR, LR_SWITCH_ON);
lr_set_debug_message( iMsg_level, LR_MSG_ON);
} //if iRecRand()
} // if( entire section
lr_continue_on_error(0); // to stop again on any error.
return 0;
} // End of generated script.
|
|