LoadRunner Practitioners Forum
cancel

how to read LB value and print as output

SOLVED
Go to solution
himanshuk
Super Contributor.

how to read LB value and print as output

I need to print tagname in output message, how to read this value of tagname or LB as output

 

for(iter=1;iter<9;iter++)
{

    snprintf(tagname, sizeof tagname, "%s%d", "td id='name",iter);

    lr_output_message ("Tagname is %s", tagname); 
    web_reg_save_param("tagname", 
    "LB=tagname", 
     "RB=</a>", 
     "Ord=ALL",
     "NotFound=ERROR",
     "IgnoreRedirections=Yes",
	LAST );

	r=lr_eval_string("tagname");
	lr_output_message("Values for tagname is :%s",r);
	

}

 

prod support
telecom

Smile tomorrow will be worse !!!
1 REPLY
Highlighted
himanshuk
Super Contributor.
Solution

Re: how to read LB value and print as output

here I got after 2 days

 

Action()
{
	int iter;
	char *r;
	char tagname[30] ;
	char str[30] ;
	char *name = "name";
    char *stage = "stage";
	char testName[1000];
	int srvCount;
	int srvTraverse;
	char * token; 
	int staCount;
	char outFlightParam[50]; // The name of the parameter for correlation 
	char outFlightParamVal[50]; // The formatted value of outFlightParam 
	char outFlightParam1[50]; 
	char outFlightParamVal1[50]; 

web_set_max_html_param_len("1300000");

	web_browser("LoginForm.jsp", 
		DESCRIPTION, 
		ACTION, 
		"Navigate=<URL>", 
		LAST);

	web_edit_field("j_username", 
		"Snapshot=t1.inf", 
		DESCRIPTION, 
		"Type=text", 
		"Name=j_username", 
		ACTION, 
		"SetValue={uID}", 
		LAST);

	web_edit_field("j_password", 
		"Snapshot=t2.inf", 
		DESCRIPTION, 
		"Type=password", 
		"Name=j_password", 
		ACTION, 
		"FireEvent=onfocus", 
		LAST);

	lr_think_time(6);

	web_edit_field("j_password_2", 
		"Snapshot=t3.inf", 
		DESCRIPTION, 
		"Type=password", 
		"Name=j_password", 
		ACTION, 
		"SetValue={pwd}", 
		LAST);

	web_button("INPUT", 
		"Snapshot=t4.inf", 
		DESCRIPTION, 
		"Type=submit",
        "Value=Login",
		"Tag=INPUT", 
		"ID=", 
		
		ACTION, 
		"UserAction=Click", 
		LAST);

	web_reg_save_param("Warning_count", "LB=title=\"Warning (", "RB=)\">", LAST);

	web_reg_save_param("Ok_count","LB=title=\"OK (","RB=)\">",LAST);


	web_reg_save_param("outFlightVal", 
        "LB=com.bea.console.handles.JMXHandle%28%22com.bea%3AName%3D", 
		"RB=%2CType%3DServer%22%29'", 
        "ORD=ALL",       
        LAST ); 


	web_reg_save_param("stateVal", 
				   "LB=<td id='state", 
				   "RB=</td>", 
				   "ORD=ALL",	
				   LAST);


	web_text_link("Servers", 
		"Snapshot=t5.inf", 
		DESCRIPTION, 
		"Text=Servers", 
		"Ordinal=1", 
		ACTION, 
		"UserAction=Click", 
		LAST);


	web_browser("Sync", 
		"Snapshot=t6.inf", 
		DESCRIPTION, 
		ACTION, 
		"Sync", 
		LAST);

	
	srvCount=atoi(lr_eval_string("{outFlightVal_count}"));
	staCount=atoi(lr_eval_string("{stateVal_count}"));


for(srvTraverse=1; srvTraverse<=srvCount; srvTraverse++)
{
	sprintf(outFlightParam, "{outFlightVal_%d}", srvTraverse); 
	sprintf(outFlightParamVal, "%s:", lr_eval_string(outFlightParam)); 

 

	sprintf(outFlightParam1, "{stateVal_%d}", srvTraverse); 
	sprintf(outFlightParamVal1, "stage%s", lr_eval_string(outFlightParam1)); 

	     token = (char *)strtok(outFlightParamVal1, ">"); 
	
		 token = (char *)strtok(NULL, ">"); 	
		 lr_output_message("%s%s",outFlightParamVal,token);
		 
}


lr_output_message("webCheckIsDone");


	return 0;
}


 

prod support
telecom

Smile tomorrow will be worse !!!