0

I am creating an automated test to verify that the login screen is displayed after 30 minutes inactivity. I start by logging in to the application and then just wait 31 minutes. Then I refresh the page and I expect that the login screen is shown.

At the moment I get the error: "WebDriverError: No active session with ID ........." when performing the refresh of the page.

I use protractor, chrome webdriver and Javascript.

The line of code that I use is "browser.refresh();"

I tried to wait less then 30 minutes and then the refreshing of the browser works fine, but then I am not able to verify that the login screen is present.

Is there a way to set the (session)timeout of the webdriver for this specific test?

1 Answers1

0

Friendly suggestion, don't automate this test. A test that has to wait 30 minutes to check something is not a good candidate for automation. This is better left as a manual test, and that's ok. We don't have to automate everything, nor should we.

That said, this answer is a few years old but suggests that you should be able to make this work with -timeout and/or -sessionTimeout

tehbeardedone
  • 2,833
  • 1
  • 15
  • 23
  • Thanks for your advice about not wanting to test this automatically. I will check your mentioned solution to see if I can get the test automated. – RolandKramer Feb 23 '22 at 15:21
  • I want to automate this test so I can run it when I am not around. I can better use my time in stead of waiting 30 minutes when I have to run this test. if it is automated I can start it when I am not at work! this test will not be part of the build pipeline. it will only run when there is lots of time like during the night. Our test set is not very big so plenty of time to have some tests which have a long duration run once in a while. – RolandKramer Feb 23 '22 at 15:28