Oops. Forgot to mention which version I am using. I have tried this with
both 1.9-RC1 and 1.9-RC2. Same results.

Thanks,
Sandeep

-----Original Message-----
From: Sandeep Rao [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 17, 2003 9:22 AM
To: JMeter Users List
Subject: regexFunction



Hi all,

I have been browsing this list for sometime and found good help in
getting started with jmeter. This is my first post and this is regarding
the regexFunction. I will appreciate if you can help me get the solution
to my problem.

Response to my first http request is in xml format and I want to parse
it and get hold of one parameter - SessionID - and use it for my second
http request. Here is the response format of first http request:

<?xml version="1.0"?>
<Authenticate>
        <SessionID>D49DD65185E94BDFBBFD2E4D872F334965</SessionID>
        ...

I want to get hold of the string 'D49DD65185E94BDFBBFD2E4D872F334965'
from the above response. Following is the structure of my test plan
setup:

- First http request
-- Response assertion
- Assertion results
- Second http request

In the Response assertion I have put in the following:

${__regexFunction(<SessionID>.*</SessionID>,$1$,1,,ss,SessionIDF)}

and in the Second http request I have added a parameter as follows:
SessionID  = ${SessionIDF}

Problem I have is that with the above format for the regex the assertion
fails with the following message:

first http request details
        Test failed, expected to contain: null

And of course, my second http request goes with the following parameter:
SessionID=null

If I change the parameter value in second request to 
SessionID  = ${SessionIDF_g1}
it still doesn't work. It sends the request with value as
SessionID=${SessionIDF_g1}

I did some tweaking and found some unexpected results. I changed the
regex function to as follows:

${__regexFunction(<SessionID>.*</SessionID>,$0$,1,,ss,SessionIDF)}

Note that the template value has changed from $1$ to $0$. When I test it
again the assertion for first request passes without any failures. But
my second request is sent with following parameters:
SessionID=<SessionID>D49DD65185E94BDFBBFD2E4D872F334965</SessionID>

This is not what I want. I only want the actual sessionid =
D49DD65185E94BDFBBFD2E4D872F334965

I know this is supposed to work and perhaps I am doing something wrong.
Can someone please help me resolve this?

Thanks a ton,
Sandeep 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to