Exemplo n.º 1
0
    def _screenshot(self, marionette, url, timeout):
        marionette.navigate(url)

        marionette.execute_async_script(self.wait_script)

        screenshot = marionette.screenshot()
        # strip off the data:img/png, part of the url
        if screenshot.startswith("data:image/png;base64,"):
            screenshot = screenshot.split(",", 1)[1]

        return screenshot
Exemplo n.º 2
0
    def _screenshot(self, marionette, url, timeout):
        try:
            marionette.navigate(url)
        except errors.MarionetteException:
            raise ExecutorException("ERROR", "Failed to load url %s" % (url,))

        marionette.execute_async_script(self.wait_script)

        screenshot = marionette.screenshot()
        # strip off the data:img/png, part of the url
        if screenshot.startswith("data:image/png;base64,"):
            screenshot = screenshot.split(",", 1)[1]

        return screenshot
Exemplo n.º 3
0
    def _screenshot(self, marionette, url, timeout):
        try:
            marionette.navigate(url)
        except errors.MarionetteException:
            raise ExecutorException("ERROR", "Failed to load url %s" % (url, ))

        marionette.execute_async_script(self.wait_script)

        screenshot = marionette.screenshot()
        # strip off the data:img/png, part of the url
        if screenshot.startswith("data:image/png;base64,"):
            screenshot = screenshot.split(",", 1)[1]

        return screenshot