Quantcast
Channel: All LoadRunner Practitioners Forum posts
Viewing all articles
Browse latest Browse all 12134

How to submit a form that item value contains new line or space?

$
0
0

Here is the flow,

I request a URL, get a JSON return,  "requestId":"abc\\nabc"

Then I use this to catch it.

web_reg_save_param_regexp("ParamName=requestId","RegExp=\"requestId\":\"(.*?)\"",
SEARCH_FILTERS,"Scope=Body",
LAST);

 In replay log, Notify: Saving Parameter "requestId = abc\nabc"

 

finally, submit the form

web_submit_data("statusPoll", "Action=http://someurl/pages/statusPoll", "Method=POST", "RecContentType=application/json", "Referer=http://someurl/pages/vehicle_status.jsp", "Snapshot=t24.inf", "Mode=HTML","EncType=",
	ITEMDATA, "Name=requestId", "Value={requestId}", ENDITEM, 
	LAST);

 In the detail log:

tor.c(93): t=132597ms: 168-byte request body for "http://someurl/pages/statusPoll" (RelFrameId=1, Internal ID=97)
tor.c(93): requestId=abc%5Cnabc

 

-------------------------- issue ------------------------

 

loadrunner did not url encode the \n newline to %0A as expected, actually loadrunner url encode \ to %5C ; n to n.

 

So, how can I got %0a in POST form?

 

and I try to use web_convert_param("requestId", "SourceEncoding=PLAIN", "TargetEncoding=URL", LAST ); It turned out some story.

 

Thank you!

 

 


Viewing all articles
Browse latest Browse all 12134

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>