lack of CR - TCP Sampler
Asked Answered
S

2

6

I am trying to use TCP Sampler for creating an automatic tests on top of IMAP4.
I am not using the Mail Reader Sampler because i need to allow injecting pure IMAP4 commands. My IMAP4 server (like any IMAP4 server) expect to receive any IMAP4 command end with CRLF (0D0A) so there fore i have ended my command in the Text to send area with a new line (Enter).

I sniffed the traffic and noticed that the JMeter added only LF (0A) after the command (without the Carriage return)

Is there something that i am missing here ?
How can i enforce JMeter TCP Sampler to add CRLF at the end of every TCP command ?

Stutsman answered 4/8, 2013 at 14:55 Comment(0)
S
2

Using XML-escaped solved the problem !!! http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

In the JMX file that is based on XML I appended the 0xD Character explicitly:

1 login [email protected] a123456A
Stutsman answered 5/8, 2013 at 13:11 Comment(0)
J
-1

While I could not get the EOL fix to work, nor the XML approach, I did find the following post which provides another solution: http://community.blazemeter.com/knowledgebase/articles/268778-how-to-send-control-characters-using-the-jmeter-tc. The general idea is to do the following:

  1. Create user defined variables called 'new_line' and 'carriage_return'.
  2. Set those user defined variables to %0A and %0D, respectively.
  3. Before your tcp sampler, create a BeanShell PreProcessor.
  4. In the BeanShell PreProcessor, overwrite the variable values like so:

    vars.put("new_line_char",URLDecoder.decode(vars.get("new_line_char"), "ASCII")); vars.put("carriage_return_char",URLDecoder.decode(vars.get("carriage_return_char"), "ASCII"));

  5. In your TCP Sampler, include your new variables at the end of your line

    some data to send to some place${carriage_return_char}${new_line_char}

Julesjuley answered 18/8, 2014 at 18:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.