Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested Keyword: View Screenshot #57

Open
schinckel opened this issue Jun 11, 2020 · 1 comment
Open

Suggested Keyword: View Screenshot #57

schinckel opened this issue Jun 11, 2020 · 1 comment

Comments

@schinckel
Copy link

When debugging robot tests that use chromeheadless, I've found that more often than not I actually want to view a screenshot of what the browser is doing at the point in time when I drop into a Debug session.

This is not quite the same as just saving a screenshot, because the file should only be temporary.

Internally, I'm using something like:

    def view_screenshot(self):
        import subprocess
        import tempfile
        from robot.libraries.BuiltIn import BuiltIn

        selenium = Builtin().get_library_instance('SeleniumLibrary')
        filename = tempfile.mkstemp(suffix='.png')[1]

        subprocess.call([
            'open',
            selenium.capture_page_screenshot(filename)
        ])
        subprocess.call(['rm', filename])

Is this something you would be prepared to include? It's probably going to require a bit of tweaking (it's geared to macOS right now, which has an open command, for instance), but I'd be happy to submit a PR if you are interested.

@xyb
Copy link
Owner

xyb commented Jun 11, 2020

I think this feature would be very helpful to users. Contributions are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants