Bug 46178

Summary: Ask newline feature for request parameter value
Product: JMeter - Now in Github Reporter: Justin <wuyg719>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED DUPLICATE    
Severity: enhancement CC: p.mouawad
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Justin 2008-11-10 15:50:50 UTC
Currently Jmeter just allows to input in a line in the http request parameter value, 
but Ajax becomes popular and need send a XML data to the server.

Multi-line input is convenient in this case. I know "Comments" of "Thread Group" allow multi-line input with default one line there.
Comment 1 Sebb 2008-11-10 16:22:39 UTC
XML does not actually require new lines between elements.

However it is sometimes useful to be able to include new-lines in parameter values.

This capability has already been added to the current (unreleased) code - there is a __char() function which can be used to insert any Unicode character value.

Also, the SOAP/XML-RPC sampler can be used to send arbitrary POST bodies.
Comment 2 Justin 2008-11-11 08:00:20 UTC
Thanks for reply.

I totally knew that XML does not actually require new lines between elements.
I just said it is not convenient for input xml element.  I wish it can be like "Comments" of "Thread Group" which allow multi-line input with default one line there.  
Comment 3 Sebb 2008-11-11 11:40:21 UTC
You can always enter the information in the comments box, and then cut and paste it into the value.

It is not trivial to support multiline input within a table.

Patches welcome.
Comment 4 Justin 2008-11-11 19:23:39 UTC
Thanks a lot. 

I have replaced "Http request sampler" with SOAP/XML-RPC request sampler. 

It is much better!!  
Comment 5 Sonam Chauhan 2009-07-07 21:15:03 UTC
Its pretty frustrating to paste a multiline string into the HTTP Sampler parameters section (Under 'Send Parameters With the Request'), and see JMeter flatten the multi-line text into a single line. This not only indicates JMeter sends 'unfaithful' data to the system under test (single-line instead of multi-line), maintaining the single-line test data is difficult.

For instance, we may be POST-ing two XML documents:
-----------------
Name: Doc1

Value: 
<Doc1>
  <DocDetails1>XXX</DocDetails1>
</Doc1>
-----------------
Name: Doc2

Value: 
<Doc2>
  <DocDetails2>ZZZ</DocDetails2>
</Doc2>
-----------------
 
Currently JMeter flattens the Doc1 and Doc2 value entries to: 
 <Doc1>  <DocDetails1>XXX</DocDetails1></Doc1>
 <Doc2>  <DocDetails2>ZZZ</DocDetails2></Doc2>
Comment 6 Philippe Mouawad 2012-01-14 22:15:31 UTC

*** This bug has been marked as a duplicate of bug 51861 ***
Comment 7 The ASF infrastructure team 2022-09-24 20:37:42 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2174