Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
Save a screenshot of the browser.

The location of the screenshot can be configured
by the environment variable `SCREENSHOT_DIR`.  If not set,
this defaults to the current working directory.

Args:
    driver (selenium.webdriver): The Selenium-controlled browser.
    name (str): A name for the screenshot, which will be used in the output file name.
(more...)

        def save_screenshot(driver, name):
    """
    Save a screenshot of the browser.

    The location of the screenshot can be configured
    by the environment variable `SCREENSHOT_DIR`.  If not set,
    this defaults to the current working directory.

    Args:
        driver (selenium.webdriver): The Selenium-controlled browser.
        name (str): A name for the screenshot, which will be used in the output file name.

    Returns:
        None
    """
    if hasattr(driver, 'save_screenshot'):
        image_name = os.path.join(
            os.environ.get('SCREENSHOT_DIR', ''), name + '.png'
        )
        driver.save_screenshot(image_name)

    else:
        msg = "Browser does not support screenshots.  Could not save screenshot '{name}'".format(name)
        LOGGER.warning(msg)
        


src/b/o/bok_choy-0.3.0/bok_choy/web_app_test.py   bok_choy(Download)
from abc import ABCMeta
from uuid import uuid4
from .browser import browser, save_screenshot
 
 
        if result != (None, None, None):
            try:
                save_screenshot(self.browser, self.id())
            except:
                pass