Robot Framework Selenium2Screenshots LibraryΒΆ

View available keywords.

Include keywords with:

*** Settings ***

Library  Selenium2Screenshots


*** Settings ***

Resource  Selenium2Screenshots/keywords.robot

Importing the keywords wth Library keyword may have compatibility issues.

Example of use:

*** 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
    Open browser
    Bootstrap jQuery
    Highlight heading  css=.main-header h1
    ${note1} =  Add pointy note
    ...    css=.main-header
    ...    This screenshot was generated using Robot Framework and Selenium.
    ...    width=250  position=bottom
    Capture and crop page screenshot  robotframework.png
    ...    css=.main-header  ${note1}


The image cropping requires PIL or Pillow.


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.