Scrollable product feed:
Java/Playwright snippet: SetseenItems = new HashSet<>(); List<WebElement> items = driver.findElements(By.cssSelector(".product-item")); for(WebElement item : items) { String id = item.getAttribute("data-id"); if(!seenItems.contains(id)) { seenItems.add(id); System.out.println("Validating item: " + id); } }
Drag the purple box into the drop zone:
Java/Playwright snippet:
WebElement source = driver.findElement(By.id("dragBox"));
WebElement target = driver.findElement(By.id("dropZone"));
Actions actions = new Actions(driver);
actions.clickAndHold(source).moveToElement(target).release().perform();
Step 1: Conditional Modal
Java/Playwright snippet:
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
WebElement modal = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".modal-dialog")));
modal.findElement(By.cssSelector(".next-btn")).click();
Enter OTP for test user:
Java/Playwright snippet:
// Fetch OTP from API or test service
String otp = OtpService.getLatestOtpForUser("testuser");
driver.findElement(By.id("otpInput")).sendKeys(otp);
driver.findElement(By.id("submitBtn")).click();
Resize the window to see layout differences:
Java/Playwright snippet:
WebDriver driverChrome = new ChromeDriver();
WebDriver driverFirefox = new FirefoxDriver();
driverChrome.get("https://example.com");
driverFirefox.get("https://example.com");
// Use visual validation or screenshot comparison