Skip to main content

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

Project description

Robot Screenshot Listener

Listener for Web based testing Screenshots with Robot framework and Selenium

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

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

. run robot command in terminal as robot --listener robotframework_auto_screenshot_listener.ScreenshotListener: <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.3.tar.gz.

File metadata

File hashes

Hashes for robotframework_auto_screenshot_listener-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f4732a8cd05cd01cc53e894dc22976274aa6f267dde0ae4e2bfea61fa080c437
MD5 51ac04ab6bf6b461828db8a4557786a1
BLAKE2b-256 835cd9dd13cffda86ca3fbab40f894d8cb0cdb4fbec5d7f0c8365459ce3a14a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for robotframework_auto_screenshot_listener-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8f8ebb061ed0f62f65acc7ea157ea788d39269a88ecbba83583c6081fc85d067
MD5 e4f8f77edb132425d0fd4f1d50d905eb
BLAKE2b-256 a8eeb0790165595a0b73bc0eb394e5d41b5635c4664c8f7367b54bdfdf36c306

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