jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adrian Speteanu <asp.ad...@gmail.com>
Subject Re: Extracting sessionid's from previously queried POST methods
Date Thu, 31 Dec 2009 14:35:31 GMT
i'm a bit rookie with the regex, but this one seems pretty easy, use this
expression:

ref_name:  extractedSessionId
regex:        "=(.+)&
template:   $1$
match:      1
default:      whatever

if you call ${extractedSessionId} you will receive your sessionid including
the " characters from your example.

this has been discussed recently, the (.+) formula is sloppy, you should
match whatever you know should be in the id, but it's should work in your
case. (for example, you could use  [a-z]+ instead of .+ if there are only
lower case alphabetical characters in the session id)


On Thu, Dec 31, 2009 at 12:46 PM, Jatin Davey <jashokda@cisco.com> wrote:

> Hi
>
> I have a following sequence of HTTP Post requests :
>
> -- Post request 1 (Does not return anything for me to extract)
> -- Post request 2 (Does not return anything for me to extract)
> -- Post request 3 (Here my client asks for session id by doing something
> like this : serviceName=GetSession)
> -- Post request 4 (Here it posts to the server with some session id like
> "=*sessionid*&agentid"
>
> All the subsequent POST requests are important for me as i pass some values
> which results in data storage in the DB. I need to extract the string :
> *sessionid *which is present between the '=' and '&' characters.
>
> Please tell me how to go about this using JMeter.
>
> Thanks
> Jatin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message