WebDriverWait & ExpectedConditionsActions API: hover, drag, keysFrames, windows & alertsShadow roots via getShadowRoot()
Two complete apps to automate end to end, plus focused element-handling recipes โ all in Selenium.
๐๏ธNova Shop
Login with test users, search/filter/sort products, cart & coupons, a validated checkout, a declined card and order history.
- โ3 test accounts incl. locked & slow
- โCart maths, coupons, tax & shipping
- โForm validation + payment failure
๐ฌShowTime
Pick city, date and showtime, select seats on a live seat map, add snacks, apply promos and pay with an OTP step under a hold timer.
- โSeat map with tiers & limits
- โCountdown timer & clock mocking
- โOTP modal, async UPI, cancellations
๐งฉ50+ challenges
Focused recipes for inputs, dropdowns, tables, alerts, frames, windows, drag & drop, uploads, hover, waits, shadow DOM and keys.
- โ15 copy-ready recipes
- โEach linked to a live challenge
- โTool-specific gotchas called out
Run this site locally with npm run dev โ examples target http://localhost:3000.
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>4.25.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.0</version>
<scope>test</scope>
</dependency>
Sign in to Nova Shop and assert the product grid loaded.
import org.junit.jupiter.api.*;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.*;
import java.time.Duration;
import static org.junit.jupiter.api.Assertions.*;
class FirstTest {
WebDriver driver = new ChromeDriver(); // Selenium Manager downloads the driver for you
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
By tid(String id) { return By.cssSelector("[data-testid='" + id + "']"); }
@Test
void demoUserCanSignIn() {
driver.get("http://localhost:3000/shop");
wait.until(ExpectedConditions.elementToBeClickable(tid("username"))).sendKeys("demo_user");
driver.findElement(tid("password")).sendKeys("Demo@123");
driver.findElement(tid("login-button")).click();
wait.until(ExpectedConditions.urlContains("/shop/products"));
assertEquals(12, wait.until(
ExpectedConditions.numberOfElementsToBe(tid("product-card"), 12)).size());
}
@AfterEach
void tearDown() { driver.quit(); }
}
Official docs: https://www.selenium.dev/documentation/