I am searching for fast ways to log into web applications(or start being logged).

Applications use cookie authentication stored in db that expire after some time. Magic url for login instantly is not allowed option.

I prefer start being logged into application(without log in every time). I prefer solution that not change applications login elements.

I think about changing cookie expire time in database, still I want to to know how other solve simillar problems.

  • Well, it depends on your application. Even if you mimic a cookie for a logged-in session, the application may well do server-side checks to see whether it should trust your login session. You may need to ask your developers. – Vince Bowdren Apr 28 '15 at 16:54

You seem to be doing tests that verify the user's frontend experience, correct? Functional tests of some sort? That means you're probably going to have to authenticate like a user would, at least once.

A few tips:

  • You can avoid automating the login form if you capture the HTTP request generated when you click "submit" and playing it back. This will save a little bit of time waiting for the login page to load.

  • You can store the cookie and re-use the same cookie between tests. This may cause state leakage between tests, but it will save some time if logging in is resource-intensive. Store the cookie information some place all your tests can get at it, like inside a static class or in a file. Have each test attempt to use the cookie and, if they get rejected, log in normally. That way, only the first test that runs after a cookie expires has to log in normally, and the rest can piggyback on that.

| improve this answer | |

What about Apache JMeter? It is

  1. Free and open source
  2. Mutithreaded by design
  3. Provides HTTP Cookie Manager to deal with cookie-based authentication
  4. Provides HTML Link Parser so it could act like a spider
| improve this answer | |
  • I know JMeter could log by with HTTP, still I want gives tester way to not log every time, so I prefer start with logged cookie(almost empty site for http login is to some level solution, still I prefer not call it). Loading logged cookie into browser seems simpler. – SkorpEN Apr 28 '15 at 11:45
  • It is possible to load cookies i.e. from CSV file and send them along with the request. – Dmitri T Apr 28 '15 at 12:37
  • 1
    This question is asking about techniques; throwing tools at a problem only helps if you know what you're trying to use it for. – Yamikuronue Apr 29 '15 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.