Fwd: Taking screenshot in headless automation --selenium python

47 views
Skip to first unread message

ganapati bhat

unread,
Aug 5, 2019, 11:50:18 AM8/5/19
to seleniu...@googlegroups.com


How to take the screenshot in headless browser in python? need a bit of information on this...

ganapati bhat

unread,
Aug 5, 2019, 11:56:03 AM8/5/19
to seleniu...@googlegroups.com
Small correction: How to take the screenshot when headless browser is running in python ???

Aionitoaie Andrei

unread,
Aug 9, 2019, 10:00:47 AM8/9/19
to Selenium Users
It should be the same as in a normal run. Without any other information, my best guess is that you do not have a virtual display on, on the machine you are running the tests.

Doug Dragon

unread,
Aug 9, 2019, 10:28:43 PM8/9/19
to Selenium Users
driver.save_screenshot('/path/to/file')

or

driver.get_screenshot_as_file('/path/to/file')

should do the trick.
Reply all
Reply to author
Forward
0 new messages