I am running Selenium automated tests in Firefox. The problem is that, when running tests on Firefox, the browser is open in "Browser is under remote control" mode and then the session cookies are not kept when the browser is closed.
Here it is the ai_session cookie when I authenticate on my web app:
Here it is the ai_session cookie after restarting the browser using the same profile:
If I authenticate on my web app without using this "Browser is under remote control" mode, the ai_session cookie is kept as expected. It only is discarded when I am on that mode.
Taking that into account:
- Is there a way to configure Firefox to keep session cookies even when running in the "Remote control" mode?
- When configuring Selenium WebDriver, is there some option that allows me to force the browser to keep the session cookies?
Edit: I consider that the answers to How can I reconnect to the browser opened by webdriver with selenium? do not fully address this question. My issue is mainly about the "Remote control" mode of Firefox. If I first authenticate on my app when Firefox is not on this "Remote control" mode, the session is kept and then I am able to use it when running my Selenium tests (so I do not need to log in again on each test). So I just need to know if it is possible to avoid using this mode when running automated tests or if it is possible to configure Firefox to keep sessions when using this mode.