Free tutorial · Beginner to intermediate
Selenium with Java
Learn web test automation with Selenium WebDriver and Java, the stack most QA job posts still ask for. Every example runs against the free practice login page on this site, so you can copy the code and see it pass on your own machine.
9 lessons · about 90 minutes of reading · free, no sign-up
Start lesson 1Getting Started
- 1What Is Selenium WebDriver?What Selenium WebDriver is, how it controls a browser, and when to use it instead of other tools.7 min
- 2Set Up Java, Maven and SeleniumInstall the JDK and IntelliJ, create a Maven project and add Selenium and TestNG dependencies.10 min
- 3Write Your First Selenium TestA complete login test with Selenium and TestNG: open the page, fill the form, submit and assert.9 min
Locators and Actions
- 4Selenium Locators: ID, CSS, XPath and MoreEvery Selenium locator strategy with examples, and the order to choose them in for stable tests.11 min
- 5Clicks, Typing, Dropdowns, Alerts, Frames and WindowsHow to handle every common element in Selenium: inputs, checkboxes, dropdowns, alerts, iframes and tabs.12 min
- 6Waits in Selenium: Implicit, Explicit and FluentWhy Selenium tests are flaky and how explicit waits fix it. Never use Thread.sleep again.9 min
Building a Framework
- 7TestNG for Selenium: Annotations, Assertions and DataTestNG annotations, hard and soft assertions, groups, data providers and testng.xml for Selenium tests.10 min
- 8Page Object Model in Selenium JavaRefactor Selenium tests with the Page Object Model: a BasePage, page classes and clean, readable tests.11 min
- 9Selenium Framework Structure, Reports and CIA clean Selenium Java framework layout with config, a driver factory, screenshots on failure, reports and CI.12 min