Welcome to the selenium-practice-lessons repository! This project is designed for practical learning and hands-on exercises in UI test automation using Selenium. It’s ideal for those who want to strengthen their Selenium skills through real-world test scenarios.
- Introduction
- Installation
- Usage
- Features
- Dependencies
- Documentation
- Examples
- Troubleshooting
- Contributors
- Contributing
- License
- Open IntelliJ IDEA.
- Select File > New > Project from Version Control.
- Enter the repository URL:
https://github.com/cihat-kose/selenium-practice-lessons.gitand click Clone. - Wait for Maven to automatically download all dependencies.
- Verify that Project SDK is set to Java 21 (or newer):
- Go to File → Project Structure → Project
- Set Project SDK and Language level appropriately.
- To confirm everything works, open the Maven panel and run:
mvn clean test
💡 No manual JAR management is needed anymore — all dependencies are managed via Maven.
- Open the project in IntelliJ IDEA.
- Navigate to the
src/test/javadirectory. - Run individual test classes or the entire test suite using:
- Right-click on a test class and select Run 'ClassName'.
- Or use the Maven command:
mvn clean test - Modify or add new tests to explore different Selenium use cases.
- Structured Maven project for easy dependency management.
- Focused practice modules on essential Selenium skills.
- Hands-on test cases covering real-world UI elements and flows.
- Easy-to-understand structure for beginners and intermediate learners.
- Demonstrates common UI automation techniques and patterns.
Managed automatically through pom.xml:
| Dependency | Version | Purpose |
|---|---|---|
org.seleniumhq.selenium:selenium-java |
4.35.0 | Core Selenium WebDriver |
junit:junit |
4.13.2 | Test framework |
com.fasterxml.jackson.core:jackson-databind |
2.20.0 | JSON processing |
com.fasterxml.jackson.datatype:jackson-datatype-jsr310 |
2.20.0 | Java 8+ date/time JSON support |
io.github.testervippro:record-video |
2.1 | Record test execution videos |
Each test file includes inline documentation explaining the scenario and Selenium functions being used.
- Locating Elements: Practice using ID, name, class, CSS Selector, and XPath.
- Interaction Methods: Perform clicks, typing, selections, and submissions.
- Action Class Examples: Hovering, drag-and-drop, and composite actions.
- Keyboard/Mouse Control: Using Robot class for OS-level control.
- Explicit Waits: Synchronize your tests with slow-loading elements.
- Implicit Waits: Set global wait defaults for driver operations.
- iFrames: Switch to frames and interact with inner elements.
- Window/Tab Management: Handle multiple browser tabs or pop-ups.
- File Upload: Handle file dialogs using both Selenium and Robot.
- Scrolling Techniques: Scroll into view or to the bottom of the page.
If you experience any issues:
- Make sure Maven dependencies are correctly downloaded (mvn clean install -U).
- Check that your browser drivers (e.g., ChromeDriver) are up-to-date.
- Ensure that your Project SDK is set correctly in IntelliJ.
- Review test logs and console output to identify failures.
- Still stuck? Open an issue on GitHub and describe your problem in detail.
- cihat-kose – Cihat Köse
- SefaKahramann – Sefa Kahraman
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Commit your changes (
git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
For more info, visit the selenium-practice-lessons GitHub page.