예제 #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
예제 #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
예제 #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