Skip to content

How to keep selenium alive and detect if session has been expired? #839

Answered by andrewnicols
plonknimbuzz asked this question in Q&A
Discussion options

You must be logged in to vote

Q1: Is possible to keep selenium alive (long live)?
Currently im using
java -Dwebdriver.chrome.driver="/var/selenium/chromedriver" -jar /var/selenium/selenium.jar -timeout 86400
i expected like -timeout 0 or -timeout -1
i know this will be bad because will cause leak memory. But i just need to know if this possible or not?

Selenium will keep running until you kill it (ctrl-c, etc).
The timeout parameter is unrelated and is the value used for waiting for a response between Selenium and the driver for each browser (i.e. Chromedriver).

Q2: How to detect if session has been expired?
The way you're doing it will work, but the stacktrace points to line 76, which is the findElement call which…

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by OndraM
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@CleberSGoncalves
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #839 on December 11, 2020 18:04.