LoadRunner Code Snippets 2

From PeformIQ Upgrade
Jump to navigation Jump to search

Some More LoadRunner Code Snippets

Write Page Content to File

	web_reg_save_param("body",
		"LB/IC=<body>",
		"RB/IC=</body>",
		"Search=Body",
		LAST);

	web_custom_request("BSPWDApplication.do", 
		"URL=http://xxxx:8000/sap(xxxx==)/bc/bsp/sap/crm_ui_frame/Application.do?id=0&sap-client=099&sap-language=EN", 
		"Method=POST", 
		"Resource=0", 
		"RecContentType=text/html", 
		"Referer=http://xxxx:8000/sap(xxxx==)/bc/bsp/sap/crm_ui_frame/Application.do?id=0&sap-client=031&sap-language=EN", 
		"Snapshot=t100.inf", 
		"Mode=HTTP", 
		"Body=htmlbevt_ty=htmlb%3Abutton%3Aclick%3A0&htmlbevt_frm=myFormId&...C1_W1_V2_MYITSLOCATION=&sap-ajax_request=X&_=", 
		LAST);

	if (pfp = fopen("0001.txt", "w")) {
		fprintf( pfp, "%s", lr_eval_string("{body}"));
		fclose(pfp);
	}