Missing CR-TCP Sampler

I am trying to use TCP Sampler to create automated tests on top of IMAP4.
I do not use Sampler Mail Reader because I need to allow clean IMAP4 commands. My IMAP4 server (like any IMAP4 server) expects to receive any IMAP4 command with CRLF (0D0A), so I ended my command in the text box to send with a new line (Enter).

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

Is there something I don't see here?
How can I get JMeter TCP Sampler to add CRLF at the end of every TCP command?

+6
source share
2 answers

Using an XML-shielded solution to the problem !!! http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

In an XML-based JMX file, I explicitly added the 0xD character:

1 login 972557557566@is433.email.com a123456A
 
+2
source

While I could not get the EOL fix to work, nor the XML approach, I found the following message that 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:

  • Create user-defined variables called 'new_line' and 'carriage_return'.
  • Set these user variables for% 0A and% 0D, respectively.
  • Before creating the tcp sampler, create a PreProcessor BeanShell.
  • In PreProcessor BeanShell, rewrite the values โ€‹โ€‹of the variables as follows:

    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"));

  • In your TCP Sampler, specify the new variables at the end of the line

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

-1
source

Source: https://habr.com/ru/post/950990/


All Articles