Added the project's obj directory to gitignore.
Added checks to ensure page is opened before screenshot.