Robot Framework Selenium2Screenshots LibraryΒΆ

View available keywords.

Include keywords with:

*** Settings ***

Library  Selenium2Screenshots

Or:

*** Settings ***

Resource  Selenium2Screenshots/keywords.robot

Importing the keywords wth Library keyword may have compatibility issues.

Example of use:

_images/robotframework.png
*** Settings ***

Library  Selenium2Library
Resource  Selenium2Screenshots/keywords.robot

Suite Teardown  Close all browsers

*** Keywords ***

Highlight heading
    [Arguments]  ${locator}
    Update element style  ${locator}  margin-top  0.75em
    Highlight  ${locator}

*** Test Cases ***

Take an annotated screenshot of RobotFramework.org
    Open browser  http://robotframework.org/
    Highlight heading  css=#header h1
    ${note1} =  Add pointy note
    ...    css=#header
    ...    This screenshot was generated using Robot Framework and Selenium.
    ...    width=250  position=bottom
    Capture and crop page screenshot  robotframework.png
    ...    header  ${note1}

Note

The image cropping requires PIL or Pillow.

Note

All keywords are written as user keywords, but later they may be refactored into Python-keywords. If this happens, there will be backwards compatible wrappers available as keywords.robot.