Skip to content

Latest commit

 

History

History
103 lines (71 loc) · 3.78 KB

README.md

File metadata and controls

103 lines (71 loc) · 3.78 KB

Selenium Automation GUI Tool

A Python-based GUI tool built with Tkinter and Selenium to automate browser actions such as clicking elements and typing text. This tool is designed for ease of use, enabling non-technical users to automate repetitive browser tasks without writing any code.

Features 1. GUI for Automation: User-friendly interface to interact with Selenium WebDriver. 2. Action Types: • Click: Select an element to click on. • Type: Select an element and input text into it. 3. Dynamic XPath Capture: Automatically generates and uses XPath for targeting elements. 4. Sequential Execution: Executes recorded actions with a configurable delay between steps. 5. Action List Management: Add, view, or clear actions in a list. 6. Thread-Safe Dialogs: Ensures the GUI remains responsive and error-free during interaction.

Prerequisites 1. Python 3.10+: Install the latest version from python.org. 2. Google Chrome: Ensure you have the latest version installed. 3. ChromeDriver: Install the appropriate version of ChromeDriver for your browser: • You can download it from the ChromeDriver page. • Ensure chromedriver is added to your system’s PATH or specify the path in the script. 4. Python Dependencies: Install required libraries:

pip install selenium

Usage 1. Clone this repository:

git clone https://github.com/your-username/selenium-automation-gui.git cd selenium-automation-gui

2.	Run the script:

python main.py

3.	Interact with the GUI:
•	Start Browser:
1.	Enter the URL in the URL field.
2.	Click the Start Browser button to launch Chrome and open the entered URL.
•	Add Actions:
•	Click Action: Select an element in the browser to record a click.
•	Type Action: Select an element and enter text to type into it.
•	Run Actions: Executes all recorded actions sequentially.
•	Clear Actions: Clears the current action list.

How It Works 1. Browser Launch: The script uses Selenium WebDriver to control Google Chrome. 2. JavaScript Injection: Injects JavaScript into the page to capture the XPath of clicked elements. 3. Action Recording: Records actions (click or type) in the GUI’s list. 4. Thread-Safe Execution: • Captures element interactions on the main thread using Tkinter’s after() method to poll. • Ensures dialogs and UI updates are safely managed. 5. Action Replay: Executes recorded actions with an adjustable delay.

Screenshots

Add relevant screenshots of the tool in action.

Known Limitations 1. XPath Fragility: Captured XPaths may break if the webpage structure changes. 2. Dynamic Pages: May require additional wait conditions for elements loaded asynchronously. 3. IFrame Support: Currently, does not handle elements inside iframes directly.

Potential Use Cases • Automating repetitive browser tasks (e.g., form filling). • Simplified web QA testing. • Educational purposes for learning Selenium and automation basics.

Future Enhancements 1. Support for IFrames: Add functionality to switch and interact with iframe elements. 2. Save/Load Actions: Allow saving recorded actions to a file and loading them later. 3. Advanced Selectors: Provide additional locator options like CSS selectors or IDs. 4. Cross-Browser Support: Extend compatibility to other browsers (e.g., Firefox, Edge).

Contributing

Contributions are welcome! To contribute: 1. Fork the repository. 2. Create a new branch:

git checkout -b feature-your-feature-name

3.	Commit your changes:

git commit -m "Add your feature or fix description"

4.	Push to the branch:

git push origin feature-your-feature-name

5.	Open a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

If you encounter any issues or have feature requests, please open an issue in the repository or contact the project maintainer.