Drupal session limit causing all tests to fail

Hi Community,

I have an issue where I’m trying to execute test on a drupal site that now has a session limit module enabled: Session Limit | Drupal.org

I have a few tests that run sequentially as part of a user journey. At the end of each test there is logout object with a delete all cookies item followed by close browser. However, the next test will fail after login as it is still showing me being logged in from the first test:

As you can see, it references the IP address. It also appends the url with “session-limit” so is in fact a different page which means all my subsequent tests fail with a WebElementNotFoundException because they are not present on that session limit page.

So far I’ve tried:

  • Running tests in incognito mode

  • Adding a delete all cookies item to the logout object

  • testing via a different ip address using a vpn

Nothing seems to work so any help would be greatly appreciated.


Have you tried contacting the Drupal folks and ask them how an automation tester might get around the limit?

I did take a look at the link you posted, but nothing seemed obvious (in fact, the wording is quite terse, to say the least).

Hi, thanks for the reply. They haven’t provided much info at all about the module at all. But I’ll try in their community space and see if anyone can shed any light.

And please post back here in case it should help others. Thanks.

It seems to me that your test script fails to logout. Why not you do WebUI.closeBrowser() per each user so that every user sessions are closed for sure?

Will do, fingers crossed

Thanks for the suggestion, I’ll try this.