-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Description
Version
Version: 1.54.0
Steps to reproduce
- Clone my repo at https://github.com/MarvellousBee/playwright-python-headless-session-bug
- pip install -r requirements.txt
- python example.py
- DO NOT PRESS 'ENTER' YET! Log into your GitHub account. This works with other websites too.
- Once you are logged in, press Enter.
- Your browser will close and you should see another browser pop up.
- 2nd browser should have you logged in automatically, because I used
launch_persistent_context
to store your session. This is just for demonstration purposes. Press Enter again to close the browser. - 3rd browser is in headless mode. You should see that you got redirected to the login page, despite using the same session:
#3 (Headless login fails!)
Got redirected to: https://github.com/login?...
Press Enter to continue...
- Press Enter to launch the final browser, without headless mode. You are logged out now!
Expected behavior
I expect the session to persist when i enable headless mode. I expected browser 3. and 4. to keep me logged in.
Actual behavior
The session is lost when browser 3. launches with headless=True.
Additional context
I'm aware that actual behavior might be expected behavior here, so is it possible to modify the code to get my expected behavior in this situation?
Environment
- Operating System: [Windows 11]
- CPU: [x86_64]
- Browser: [Chromium]
- Python Version: [3.10.6]
- Other info:
Metadata
Metadata
Assignees
Labels
No labels