jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sasidharsmit <sasidhars...@gmail.com>
Subject Clear authentication credentials
Date Wed, 14 Dec 2011 10:29:41 GMT
Dear All,
I have a test plan, that has 2 samplers.

1. Open Session
2. Close Session

The application that I'm testing is a webservice and I'm using SOAP/XML-RPC
samplers.

The application authenticates the user via DIGESTauthentication. So, I add
the "Authorization Manager" config element to enable authorization.

Open Session opens a session and returns a session id. I pass this session
id to Close Session, along with the same user's authentication credentials
and Close Session, closes this session.

There is one "Authorization Manager" per sampler, so that both the samplers
use the same credentials, within one iteration (i.e.) if Open Session reads
line 1 of "UserDetails.csv", Close Session also reads line 1 of
"UserDetails.csv"

This is what happens when I run the test plan:

1. Open Session finishes successfully
2. Authentication credentials passed are as expected
3. Close Session ends in failure
4. The error message says "No such session exists"

The following are some actions I took to *debug *the test plan:                          
                                 

1. I added a cookie manager to see if it makes any difference. It does not.
With or without cookies, I get the same result.

2. I have no way to check what is the credential that is being passed in to
Close Session, because the credentials are encrypted and even the server
logs do not reveal which session is closed

3. So, I removed all users but one from my "UserDetails.csv" file, which is
being used by the "Authorization Manager". So, now the same use that is
being used for Open Session should be used for Close Session.

4. Still, I get a "No such session" exception

5. Next step, instead of using "UserDetails.csv" for Close Session
"Authorization Manager", I decided to pass the credentials from Open Session
to Close Session (i.e.) the same user which will be used for Open Session
will be passed to a parameter, which will be used by the close Session
"Authorization Manager"

6. This also throws "No such session" exception

7. In the end, I decided to do step 5 using a file (i.e.)the same user which
will be used for Open Session will be written to a file, which will be read
by a beanshell preprocessor in close Session and used by the close Session
"Authorization Manager"

8. This also throws "No such session" exception


*Turning point:*
----------------

1. Now, I disabled Close Session and ran only Open Session

2. I copied the session id and pasted it in close session request

3. Now, I disabled open session and ran only close session (no cookies
passed)

4. IT WORKED!!

So, if I terminate the testtplan after open session and use the same session
id in the close session request (in a new run), then it works.
But, if I pass the session id within the same run and try to close the
session, it doesnot work. It throws a "No such session" exception

I thought may be it takes time, for the session id to be synchronized with
the DB. So, I gave a constant timer of around 10 sec in between the samplers
and tried again. No luck. It fails.

I believe that this is a problem with the way, the authorization credentials
are being passed in to the request for close session.

Is there a way to clear the authorization credentials before I start the
close session? 

I saw in the source code for "AuthManager" class within the package
"org.apache.jmeter.protocol.http.control", that there is a *clear()* method.
Can this help?
 How do I use this to clear the credentials?

I tried the below code:

/
package org.apache.jmeter.protocol.http.control;
AuthManager am = new AuthManager();
am.clear();/

It didn't work.

Any suggestions?

Thanks and Regards,
Sasidhar Sekar


--
View this message in context: http://jmeter.512774.n5.nabble.com/Clear-authentication-credentials-tp5074116p5074116.html
Sent from the JMeter - User mailing list archive at Nabble.com.

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


Mime
View raw message