Skip to main content

A Robot Framework listener that automatically takes screenshots before each keyword.

Project description

Robot Screenshot Listener

Listener for Automation testing Screenshots with Robot framework-Selenium,Browser and Appium Libraries

Installation

pip install robotframework-auto-screenshot-listener

Project Structure

Robot Screenshot Listener
├── robotframework_auto_screenshot_listener
│   ├── __init__.py               # Entry point of the application
│   ├── ScreenshotListener.py      # Handles reading and filtering messages
├── requirements.txt           # Lists project dependencies
└── README.md                  # Project documentation

Monitored Selenium Keywords The listener captures screenshots for the following Selenium keywords:

  1. Click Element
  2. Input Text
  3. Press Keys
  4. Get Text
  5. Get Element Attribute
  6. Page Should Contain
  7. Page Should Not Contain
  8. Element Should Be Visible
  9. Element Should Not Be Visible
  10. Close Browser
  11. Click Button
  12. Click Link
  13. Click
  14. Fill Text

How It Works . Test Start: Creates a root directory and test-specific subdirectory . Keyword Execution: Before each monitored Selenium keyword, captures a screenshot . File Naming: Screenshots are named sequentially (selenium_0.png, selenium_1.png, etc.) . Test End: Resets the screenshot counter for the next test

Technical Details Class Structure . API Version: Uses Robot Framework Listener API version 2 . Key Methods: . start_test(): Initializes test-specific screenshot directory . start_keyword(): Captures screenshots before keyword execution . end_keyword(): Handles post-keyword cleanup Dependencies . robot.libraries.BuiltIn: For accessing Robot Framework variables and keywords . robot.libraries.String: For string manipulation . os: For file system operations . shutil: For directory operations

Usage

robot --listener robotframework_auto_screenshot_listener.ScreenshotListener:ScreenshotDirectoryName <TestFilePath.robot>

Contributing

Feel free to submit issues or pull requests if you have suggestions or improvements for the project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file robotframework_auto_screenshot_listener-0.1.6.tar.gz.

File metadata

File hashes

Hashes for robotframework_auto_screenshot_listener-0.1.6.tar.gz
Algorithm Hash digest
SHA256 cca8d1d5b88754738e994f57640edb6c2e25d75d7ac7f1c43b874de8ada7d9e8
MD5 8097aeec61337b2fe40a0f34edbd78a8
BLAKE2b-256 5823061d65c950c98469921d277e06c873a0ab0177550d06fca0f9025e952999

See more details on using hashes here.

File details

Details for the file robotframework_auto_screenshot_listener-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for robotframework_auto_screenshot_listener-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 56d7dfbf38434c9b27645bed79437f23c67990b07794c4dffad50c75fb7b3d8b
MD5 2adca617e7d35076889d04b8b8a7e967
BLAKE2b-256 8c2a632c9dcdb8adfae8ae66fa2aa4f7f774d96f76228943f045a4de13d1854b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page