Advertisement
AlexandrP

Untitled

May 10th, 2024
798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1.      // Wait until the expiration dropdown is visible
  2.         WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
  3.         WebElement expirationDropdown = wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("select2-selection__rendered")));
  4.  
  5.         // Click to open the dropdown
  6.         expirationDropdown.click();
  7.  
  8.         // Select option by visible text
  9.         WebElement tenMinutesOption = driver.findElement(By.xpath("//li[text()='10 Minutes']"));
  10.         tenMinutesOption.click();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement