Body Data Contains Parameter Delimiter

From PeformIQ Upgrade
Revision as of 16:24, 24 September 2014 by PeterHarding (talk | contribs) (Created page with "=Overview= Somtimes HTML body contains data which uses the LoadRunner parameter delimiters '{' and '}'. Rendering this in web calls will break the parameter substitution. O...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Overview

Somtimes HTML body contains data which uses the LoadRunner parameter delimiters '{' and '}'. Rendering this in web calls will break the parameter substitution. One way to avoid this is to use an alternative pair of delimiter characters - for example, to something like '[' and ']', provided the HTML data does not contain these.

Where this occurs in only a small number of HTML pages it may be simpler to do something like this:

	char body[128];

	sprintf(body, "{Location: \"%f,%f\" }", location.latitude, location.longitude);
    
        lr_save_string(body, "Body");
    
	web_custom_request("SetCurrentLocation", 
		"URL=https://{Host}/{Application}/Application/SetCurrentLocation", 
		"Method=POST", 
		"Resource=0", 
		"RecContentType=application/json", 
		"Referer=https://{Host}/{Application}/Application", 
		"Snapshot=t16.inf", 
		"Mode=HTML", 
		"EncType=application/json", 
		"Body={Body}", 
		LAST);