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:
- Click Element
- Input Text
- Press Keys
- Get Text
- Get Element Attribute
- Page Should Contain
- Page Should Not Contain
- Element Should Be Visible
- Element Should Not Be Visible
- Close Browser
- Click Button
- Click Link
- Click
- 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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file robotframework_auto_screenshot_listener-0.1.8.tar.gz.
File metadata
- Download URL: robotframework_auto_screenshot_listener-0.1.8.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eee11e05266c7936521b0e1cb9a83e774d530fcee90a2a1e191bf008971b7d4
|
|
| MD5 |
55a31b9f4907d7c2f8ae1425aa76807b
|
|
| BLAKE2b-256 |
831ede76870a112d7fcb80421afeb3ade58f60e890c67f4e9a72f605383c80a6
|
File details
Details for the file robotframework_auto_screenshot_listener-0.1.8-py3-none-any.whl.
File metadata
- Download URL: robotframework_auto_screenshot_listener-0.1.8-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3627a566252a2105a4ee96c8ccc836a90052fdd79a6bf7435306ea8d59092b71
|
|
| MD5 |
fef03a2a6843ee153f31c4fe3409553d
|
|
| BLAKE2b-256 |
854b22d31a3e7e44f6d9c8b94c5d176e9cc6763a3aa8dab2f039e03c2abec1c9
|