1

For example, let's say I am on the stackoverflow log in page in the chrome webdriver. I want it to be not headless, but if the user signs in, I want the chrome webdriver to switch to headless.

TheRealTengri
  • 1,201
  • 1
  • 7
  • 17
  • Never tried this before, but I'm not sure it's any more possible then switching from chrome to firefox would be. You probably _could_ do it by starting up a new driver passing in session information stored in the first driver... but I'm not sure what benefit you would get out of doing this. – mrfreester Jul 24 '19 at 20:40
  • Possible duplicate of [How do I make Chrome Headless after I login manually](https://stackoverflow.com/questions/53296228/how-do-i-make-chrome-headless-after-i-login-manually) – mrfreester Jul 24 '19 at 20:44
  • Its headless or not, you cannot switch between the modes. If you want to be creative, you could log in not headless, save the session from the cookies or HTTP headers, close the browser -> launch headless browser and set the cookie and/or HTTP headers to re-use the session that was created in the non-headless mode. – Homewrecker Jul 25 '19 at 07:44

0 Answers0