I'd like to have a screenshot of how the browser looked like when an error (context deadline exceeded) occurs (preferably in both headless and headed modes).
I added chromedp.Screenshot(...) to the chromedp.Run flow and the screenshot it taken properly when the run passes, however when it fails, the error occurs before the Screenshot step and causes the browser to be closed so it's too late to capture the screenshot. Thank you!
A workaround is utilize the screencast feature and save the last frame (or several frames) when something goes wrong: