jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sonam Chauhan <sonam.chau...@ce.com.au>
Subject problems with LF in test documents
Date Fri, 16 Apr 2004 07:25:48 GMT
Hello - I'd appreciate inputs on a problem using the HTTP request sampler
with line feed (LF) characters. 

Background
=================
I need to HTTP POST a plain text EDI document with Line Feed (\n) characters
as line terminators. The document must to be posted with these terminators
in order for the EDI parser in the HTTP server to parse it properly.
According to the HTTP RFC, all HTTP servers "must" accept such documents
(even though the canonical line termination for the HTTP protocol is
"carriage return + line feed"). I also modified the document to have JMeter
${...} variables embedded in it in order to fulfill test document uniqueness
constraints.

Problem
=================
When I try using the JMeter HTTP request sampler to post this document, I
paste the document into the sampler's 'Send Parameter with Request' Value
box. However, this converts the line terminator into a space. 

So if I have data like this:
----------------
xyz
abc
----------------
The URL-encoded data sent out by JMeter is "xyz+abc" instead of "xyz%0Aabc"
(%0A is the URL-encoding of the LF character)

I tried using a JMeter proxy to auto-generate the posted data. However, the
data is posted by a custom HTTP client (not a web browser) which I cannot
point to the proxy. I tried posting the LF terminated data from a form using
a web browser but that didn't work either (gave a similar result.)

Workaround 
=================
I have a very workaround in place:
1. Take the raw LF terminated data
2. URL-encode it outside of JMeter
3. Goto the JMeter variables in the URL-encoded data. Un-URLencode only the
section of text containing the variables. This is required so that the
${...} variables are properly substituted by JMeter at runtime. 
4. Paste the modified URL-encoded data into the HTTP sampler. 
5. Ensure the HTTP sampler 'Encode' tickbox is UN-ticked. 

This workaround does result in the document being properly processed, but it
is quite cumbersome.

I'm not sure if LF --> Space translation is a Java/Swing limitation or a
JMeter limitation - I'd appreciate any inputs. 

With regards,
Sonam Chauhan
-- 
Corporate Express Australia Ltd.
Phone: +61-2-9335-0725, Fax: 9335-0753, Email: sonamc@ce.com.au
 


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Mime
View raw message