# AutoBotLibrary
AutoBotLibrary is a Python library designed to integrate with Robot Framework to enable seamless GUI automation. It builds upon [PyAutoGUI](https://pyautogui.readthedocs.io/en/latest/index.html) to provide a comprehensive set of utilities for mouse control, keyboard interactions, dialog handling, and image-based UI automation.
## Features
- **Mouse control**: movement, clicks, dragging, and scrolling.
- **Keyboard control**: typing, pressing keys, and key combinations.
- **Dialog box handling**: alerts, confirmations, prompts, and password inputs.
- **Screen handling**: resolution retrieval, screenshots, and image-based element location.
- **Robot Framework** integration for test automation.
## Documentation
You can find the keyword documentation [here](https://deekshith-poojary98.github.io/robotframework-autobotlibrary/).
## Installation
```bash
pip install robotframework-autobotlibrary
```
## Importing the Library
In your Robot Framework test suite:
```robot
*** Settings ***
Library AutoBotLibrary
```
In Python:
```py
from AutoBotLibrary import AutoBotLibrary
```
## Example Usage in Robot Framework
```robot
*** Test Cases ***
Mouse and Keyboard Automation
# Move the mouse to coordinates (100, 200) over 1 second
Move Mouse To 100 200 move_duration=1
# Click at (100, 200)
Click x_cord=100 y_cord=200
# Type the text "Hello, World!"
Type Text text=Hello, World!
Image-Based Automation
# Find the location of an image on the screen
${location}= Find On Screen image_path=button.png
# Wait until the image appears
${center}= Wait Until Image Appears image_path=button.png
Dialog Handling
# Display an alert box
${response}= Alert Box alert_message=Task Complete!
# Show a confirmation box
VAR @{list_of_buttons} Yes No
${confirmation}= Confirm Box confirm_message=Proceed? button_labels=${list_of_buttons}
```
## Example Usage in Python
```py
from AutoBotLibrary import AutoBotLibrary
robot = AutoBotLibrary()
# Move the mouse to (200, 300)
robot.move_mouse_to(200, 300, move_duration=0.5)
# Take a screenshot
screenshot_path = robot.take_screenshot(filepath="screenshot.png")
print(f"Screenshot saved at: {screenshot_path}")
# Display a confirmation dialog box
response = robot.confirm_box(confirm_message="Do you want to continue?", button_labels=["Yes", "No"])
print(f"User selected: {response}")
# Wait until an image appears on the screen
location = robot.wait_until_image_appears("button.png", timeout=15)
print(f"Button found at: {location}")
```
## Available Methods
### Mouse Control
- `get_screen_resolution()`: Get the screen's width and height.
- `get_mouse_position()`: Get the current position of the mouse.
- `move_mouse_to(x, y, duration, motion)`: Move the mouse to a specific position.
- `click(x, y, click_count, delay, button)`: Perform mouse clicks.
- `drag_to(x, y, button, motion, duration)`: Drag the mouse to a specific position.
### Keyboard Control
- `type_text(text, delay)`: Type text with a specified delay between keystrokes.
- `press_key(keys, count, delay)`: Press a key or combination of keys.
- `press_and_hold_key(key)`: Press and hold a key.
- `release_key(key)`: Release a key.
- ### Dialog Handling
- `alert_box(message, title, button)`: Display an alert dialog box.
- `confirm_box(message, title, buttons)`: Display a confirmation dialog.
- `prompt_box(message, title, default)`: Display a prompt box for user input.
- `password_box(message, title, default, mask)`: Display a password input box.
### Image-Based Automation
- `find_on_screen(image_path, confidence, region, gray_scale)`: Locate an image on the screen.
- `find_image_center(image_path, confidence, region, gray_scale)`: Find the center of an image on the screen.
- `wait_until_image_appears(image_path, confidence, region, gray_scale, timeout)`: Wait for an image to appear on the screen.
- ### Screen Capture
- `take_screenshot(filepath, region)`: Capture a screenshot of the screen or a specific region.
## Contributions
Contributions, issues, and feature requests are welcome! Feel free to open a pull request or issue on the GitHub repository.
## License
This project is licensed under the [BSD-3-Clause License](https://github.com/deekshith-poojary98/robotframework-autobotlibrary?tab=License-1-ov-file).
Raw data
{
"_id": null,
"home_page": "https://github.com/deekshith-poojary98/robotframework-autobotlibrary",
"name": "robotframework-autobotlibrary",
"maintainer": "Deekshith Poojary",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "gui desktop testing testautomation robotframework robotframework-autobotlibrary",
"author": "Deekshith Poojary",
"author_email": "deekshithpoojary355@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/0d/43/75270c273fc6629ec32fba2caf2511c3c4647b00998213aef40399e23176/robotframework-autobotlibrary-1.0.0.tar.gz",
"platform": null,
"description": "# AutoBotLibrary\nAutoBotLibrary is a Python library designed to integrate with Robot Framework to enable seamless GUI automation. It builds upon [PyAutoGUI](https://pyautogui.readthedocs.io/en/latest/index.html) to provide a comprehensive set of utilities for mouse control, keyboard interactions, dialog handling, and image-based UI automation. \n\n## Features\n- **Mouse control**: movement, clicks, dragging, and scrolling.\n- **Keyboard control**: typing, pressing keys, and key combinations.\n- **Dialog box handling**: alerts, confirmations, prompts, and password inputs.\n- **Screen handling**: resolution retrieval, screenshots, and image-based element location.\n- **Robot Framework** integration for test automation.\n\n## Documentation\nYou can find the keyword documentation [here](https://deekshith-poojary98.github.io/robotframework-autobotlibrary/).\n\n## Installation\n```bash\npip install robotframework-autobotlibrary\n```\n\n## Importing the Library\nIn your Robot Framework test suite:\n\n```robot\n*** Settings ***\nLibrary AutoBotLibrary\n```\n\nIn Python:\n```py\nfrom AutoBotLibrary import AutoBotLibrary\n```\n\n## Example Usage in Robot Framework\n```robot\n*** Test Cases ***\nMouse and Keyboard Automation\n # Move the mouse to coordinates (100, 200) over 1 second\n Move Mouse To 100 200 move_duration=1\n \n # Click at (100, 200)\n Click x_cord=100 y_cord=200\n \n # Type the text \"Hello, World!\"\n Type Text text=Hello, World!\n\nImage-Based Automation\n # Find the location of an image on the screen\n ${location}= Find On Screen image_path=button.png\n \n # Wait until the image appears\n ${center}= Wait Until Image Appears image_path=button.png\n\nDialog Handling\n # Display an alert box\n ${response}= Alert Box alert_message=Task Complete!\n \n # Show a confirmation box\n VAR @{list_of_buttons} Yes No\n ${confirmation}= Confirm Box confirm_message=Proceed? button_labels=${list_of_buttons}\n```\n\n## Example Usage in Python\n```py\nfrom AutoBotLibrary import AutoBotLibrary\n\nrobot = AutoBotLibrary()\n\n# Move the mouse to (200, 300)\nrobot.move_mouse_to(200, 300, move_duration=0.5)\n\n# Take a screenshot\nscreenshot_path = robot.take_screenshot(filepath=\"screenshot.png\")\nprint(f\"Screenshot saved at: {screenshot_path}\")\n\n# Display a confirmation dialog box\nresponse = robot.confirm_box(confirm_message=\"Do you want to continue?\", button_labels=[\"Yes\", \"No\"])\nprint(f\"User selected: {response}\")\n\n# Wait until an image appears on the screen\nlocation = robot.wait_until_image_appears(\"button.png\", timeout=15)\nprint(f\"Button found at: {location}\")\n```\n\n## Available Methods\n### Mouse Control\n- `get_screen_resolution()`: Get the screen's width and height.\n- `get_mouse_position()`: Get the current position of the mouse.\n- `move_mouse_to(x, y, duration, motion)`: Move the mouse to a specific position.\n- `click(x, y, click_count, delay, button)`: Perform mouse clicks.\n- `drag_to(x, y, button, motion, duration)`: Drag the mouse to a specific position.\n\n### Keyboard Control\n- `type_text(text, delay)`: Type text with a specified delay between keystrokes.\n- `press_key(keys, count, delay)`: Press a key or combination of keys.\n- `press_and_hold_key(key)`: Press and hold a key.\n- `release_key(key)`: Release a key.\n\n- ### Dialog Handling\n- `alert_box(message, title, button)`: Display an alert dialog box.\n- `confirm_box(message, title, buttons)`: Display a confirmation dialog.\n- `prompt_box(message, title, default)`: Display a prompt box for user input.\n- `password_box(message, title, default, mask)`: Display a password input box.\n\n### Image-Based Automation\n- `find_on_screen(image_path, confidence, region, gray_scale)`: Locate an image on the screen.\n- `find_image_center(image_path, confidence, region, gray_scale)`: Find the center of an image on the screen.\n- `wait_until_image_appears(image_path, confidence, region, gray_scale, timeout)`: Wait for an image to appear on the screen.\n\n- ### Screen Capture\n- `take_screenshot(filepath, region)`: Capture a screenshot of the screen or a specific region.\n\n## Contributions\nContributions, issues, and feature requests are welcome! Feel free to open a pull request or issue on the GitHub repository.\n\n## License\nThis project is licensed under the [BSD-3-Clause License](https://github.com/deekshith-poojary98/robotframework-autobotlibrary?tab=License-1-ov-file).\n\n\n",
"bugtrack_url": null,
"license": "BSD-3-Clause License",
"summary": "Robot Framework library wrapper for PyAutoGUI.",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/deekshith-poojary98/robotframework-autobotlibrary"
},
"split_keywords": [
"gui",
"desktop",
"testing",
"testautomation",
"robotframework",
"robotframework-autobotlibrary"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fd5558312571ef10ab0bd58b57a5ec402066dfc96daad35aeca7a65a17a082f5",
"md5": "493742bc6ba5022264c9f54cabd128f8",
"sha256": "49a30a4efc5419cb6a0fe1ef95b790ba6bf40f6c5d903c58b4d0507c870b6d2d"
},
"downloads": -1,
"filename": "robotframework_autobotlibrary-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "493742bc6ba5022264c9f54cabd128f8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 11752,
"upload_time": "2024-11-17T18:52:49",
"upload_time_iso_8601": "2024-11-17T18:52:49.949344Z",
"url": "https://files.pythonhosted.org/packages/fd/55/58312571ef10ab0bd58b57a5ec402066dfc96daad35aeca7a65a17a082f5/robotframework_autobotlibrary-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0d4375270c273fc6629ec32fba2caf2511c3c4647b00998213aef40399e23176",
"md5": "f14cad39a0acc46df975b34182631986",
"sha256": "51bd922d506988f3acdbd52f6f91f091e241974d68839884d32949523262e0d8"
},
"downloads": -1,
"filename": "robotframework-autobotlibrary-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "f14cad39a0acc46df975b34182631986",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 11207,
"upload_time": "2024-11-17T18:52:52",
"upload_time_iso_8601": "2024-11-17T18:52:52.201105Z",
"url": "https://files.pythonhosted.org/packages/0d/43/75270c273fc6629ec32fba2caf2511c3c4647b00998213aef40399e23176/robotframework-autobotlibrary-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-17 18:52:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "deekshith-poojary98",
"github_project": "robotframework-autobotlibrary",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "robotframework-autobotlibrary"
}