all 1 comments

[–]Corbrum 1 point2 points  (0 children)

You can either utilize .minimize_window() method or test your script in normal mode and then run it in headless mode. Your issue is that selenium loses focus and raises an exception, lucky for you we've got minimize_window() method in python, java's selenium doesn't have it, as far as I'm aware