You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Nikolay Miroshnichenko <mi...@rosenergo.com> on 2011/08/26 19:00:21 UTC

Jmeter as MDA (mail delivery agent) for calling by external scripts

Hi!

Have Anyone used JMeter as a MDA, just as a tool for reading emails?
How to do it conveniently?
I mean, it's rather easy and quickly to read and deal with mail messages
inside JMeter, but
problems arise when trying to get the messages from an external script or
tool.

Having JMeter 2.5, I add "Mail Reader Sampler" and "Save Responses to a
file" listener.

Then I read all the saved files with another functional testing tool.

But the problem is that "Save Responses to a file" listener saves many files
per one message
 (at least two: one for headers and one or more - for body).

If to mark "Store the message using MIME (raw)" checkbox, the number of
saved files is correct
 - it equals to the number of messages, but then there is another problem: 
the messages bodies become unreadable in those saved files (and also in
"View Results Tree" listener).

So, if there is an easy or common way to resolve this double problem?
How know the exact number of following body parts from a "headers file" or 
how to convert MIME raw content to normal text?

Thank you,
Nikolay


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


RE: Jmeter as MDA (mail delivery agent) for calling by external scripts

Posted by Nikolay Miroshnichenko <mi...@rosenergo.com>.
I've solve the problem - I use JMeter 2.3.4 as a mail reading tool - it
saves one file per message (in non-raw format).
JMeter 2.4-2.5 ("Save Responses to a file" listener) saves many files per 1
message if the latter is "multi-part" (very common).

Another (JMeter version agnostic) solution is to save messages in a raw
format and decode it later with a tool like
http://www.fourmilab.ch/webtools/base64/
But it's a more cumbersome way because we should decode only some parts of a
message (between " ------=_NextPart_.+" lines).
So, 1) first we need to find only messages containing that line (or line "
This is a multi-part message in MIME format."),
2. then copy encoded parts to a tmp file, 3) decode it, 4) add to the source
file.
(Also we can use another tool, even JMeter (or Java mail) classes, maybe
they can filter out unencoded parts of a message).

By the way, you need to set up the sample and the listener such way in a
testplan in JMeter for saving only files representing mail messages and not
parent jmeter responces:
...
  |_Mail Reader Sampler
    |_Response Assertion: "Main sample only", "Text Response", "Patterns to
test=any text that surely will fail the sample"

...
    |_Save Responses to a file: "Save Successful Responses only" (so, the
parent responses will not be saved as files).


-----Original Message-----
From: Nikolay Miroshnichenko [mailto:mirnik@rosenergo.com] 
Sent: Friday, August 26, 2011 9:00 PM
To: 'JMeter Users List'
Subject: Jmeter as MDA (mail delivery agent) for calling by external scripts

Hi!

Have Anyone used JMeter as a MDA, just as a tool for reading emails?
How to do it conveniently?
I mean, it's rather easy and quickly to read and deal with mail messages
inside JMeter, but
problems arise when trying to get the messages from an external script or
tool.

Having JMeter 2.5, I add "Mail Reader Sampler" and "Save Responses to a
file" listener.

Then I read all the saved files with another functional testing tool.

But the problem is that "Save Responses to a file" listener saves many files
per one message
 (at least two: one for headers and one or more - for body).

If to mark "Store the message using MIME (raw)" checkbox, the number of
saved files is correct
 - it equals to the number of messages, but then there is another problem: 
the messages bodies become unreadable in those saved files (and also in
"View Results Tree" listener).

So, if there is an easy or common way to resolve this double problem?
How know the exact number of following body parts from a "headers file" or 
how to convert MIME raw content to normal text?

Thank you,
Nikolay


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



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