jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Extracting sessionid's from previously queried POST methods
Date Fri, 01 Jan 2010 15:28:56 GMT
On 31/12/2009, Adrian Speteanu <asp.adieu@gmail.com> wrote:
> 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)

Or use

"=([^&]+)&

i.e. anything except & is captured

>

Also, attach the RE  element as a child of the sampler that returns
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
>  >
>  >
>

---------------------------------------------------------------------
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