pulpet112
pulpet112

Reputation: 43

Session doesn't exist after log in in JMeter

I'm making log in test in JMeter and i have a problem. I made a HTTP Request as a POST method and it works - I get a JavaScript response (new popup). So the next step is another HTTP Request which return the page after log in. But instead of getting this page in return, I got another page which informs that session doesn't exist. What is wrong?

Upvotes: 1

Views: 713

Answers (4)

Partha Kidambi
Partha Kidambi

Reputation: 1

I have the same issue. The authentication cookie was not sent and the request body shows "unauthenticated_session=deleted" under Cookie Data instead of the token values. I resolved it by adding additional forward slashes in path by trial and error method. Some endpoints (javascript based http requests) work with // and some with /// or ////. Weird but works for me.

Upvotes: 0

pulpet112
pulpet112

Reputation: 43

Thanks!! It helps with log in but I have simmilar problem going further. After log in I can see a desktop with some icons. Clicking on one of this icon open a PopUp in JavaScript. I looked at POST methods - one of them has a JS code which open this PopUp as a POST response. I added it to my Test Plan. But instead of getting a js response like " new Window ({...." I receive object.SessionTimeOutAlert()". I think that this is a common problem. But now I have HTTP Header Manager and HTTP Cookie Manager and nothing....

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168082

  1. Make sure you add HTTP Cookie Manager to your Test Plan
  2. Make sure you detect and handle all dynamic parameters in some cases for security or state management or whatever server expects some extra parameters in addition to credentials and in case of missing or mismatch with expected logic can fail. So the test should look like:

    • GET request to the login page
    • POST request to login page (pass credentials and dynamic parameters)

See How To Use JMeter For Login Authentication guide for more detailed explanation and example.

Upvotes: 1

Iske
Iske

Reputation: 1200

Add HTTP Header Manager and HTTP Cookie Manager to your test plan. Session IDs needs to be managed.

Upvotes: 0

Related Questions