|
| def | capture_element_screenshot (self, locator, filename='selenium-element-screenshot-{index}.png') |
| | Captures screenshot from the element identified by locator and embeds it into log file. More...
|
| |
| def | capture_page_screenshot (self, filename='selenium-screenshot-{index}.png') |
| | Takes screenshot of the current page and embeds it into log file. More...
|
| |
| def | set_screenshot_directory (self, path) |
| | Sets the directory for captured screenshots. More...
|
| |
| def | assert_page_contains (self, locator, tag=None, message=None, loglevel='TRACE') |
| |
| def | assert_page_not_contains (self, locator, tag=None, message=None, loglevel='TRACE') |
| |
| def | debug (self, msg, html=False) |
| |
| def | get_timeout (self, timeout=None) |
| |
| def | info (self, msg, html=False) |
| |
| def | log (self, msg, level='INFO', html=False) |
| |
| def | log_source (self, loglevel='INFO') |
| |
| def | warn (self, msg, html=False) |
| |
| def | __init__ (self, ctx) |
| | Base class exposing attributes from the common context. More...
|
| |
| def | find_element (self, locator, tag=None, required=True, parent=None) |
| | Find element matching locator. More...
|
| |
| def | find_elements (self, locator, tag=None, parent=None) |
| | Find all elements matching locator. More...
|
| |
| def | is_element_enabled (self, locator, tag=None) |
| |
| def | is_text_present (self, text) |
| |
| def | is_visible (self, locator) |
| |
Definition at line 25 of file screenshot.py.
| def SeleniumLibrary.keywords.screenshot.ScreenshotKeywords.capture_page_screenshot |
( |
|
self, |
|
|
|
filename = 'selenium-screenshot-{index}.png' |
|
) |
| |
Takes screenshot of the current page and embeds it into log file.
``filename`` argument specifies the name of the file to write the
screenshot into. The directory where screenshots are saved can be
set when `importing` the library or by using the `Set Screenshot
Directory` keyword. If the directory is not configured, screenshots
are saved to the same directory where Robot Framework's log file is
written.
Starting from SeleniumLibrary 1.8, if ``filename`` contains marker
``{index}``, it will be automatically replaced with unique running
index preventing files to be overwritten. Indices start from 1,
and how they are represented can be customized using Python's
[https://docs.python.org/3/library/string.html#format-string-syntax|
format string syntax].
An absolute path to the created screenshot file is returned.
Examples:
| `Capture Page Screenshot` | |
| `File Should Exist` | ${OUTPUTDIR}/selenium-screenshot-1.png |
| ${path} = | `Capture Page Screenshot` |
| `File Should Exist` | ${OUTPUTDIR}/selenium-screenshot-2.png |
| `File Should Exist` | ${path} |
| `Capture Page Screenshot` | custom_name.png |
| `File Should Exist` | ${OUTPUTDIR}/custom_name.png |
| `Capture Page Screenshot` | custom_with_index_{index}.png |
| `File Should Exist` | ${OUTPUTDIR}/custom_with_index_1.png |
| `Capture Page Screenshot` | formatted_index_{index:03}.png |
| `File Should Exist` | ${OUTPUTDIR}/formatted_index_001.png |
Definition at line 85 of file screenshot.py.
| def SeleniumLibrary.keywords.screenshot.ScreenshotKeywords.set_screenshot_directory |
( |
|
self, |
|
|
|
path |
|
) |
| |
Sets the directory for captured screenshots.
``path`` argument specifies the absolute path to a directory where
the screenshots should be written to. If the directory does not
exist, it will be created. The directory can also be set when
`importing` the library. If it is not configured anywhere,
screenshots are saved to the same directory where Robot Framework's
log file is written.
The previous value is returned and can be used to restore
the original value later if needed.
Returning the previous value is new in SeleniumLibrary 3.0.
The persist argument was removed in SeleniumLibrary 3.2.
Definition at line 43 of file screenshot.py.