Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created April 25, 2025 12:09
Show Gist options
  • Select an option

  • Save SarahElson/a26e99c95985b138099373ee429dce11 to your computer and use it in GitHub Desktop.

Select an option

Save SarahElson/a26e99c95985b138099373ee429dce11 to your computer and use it in GitHub Desktop.

Revisions

  1. SarahElson created this gist Apr 25, 2025.
    19 changes: 19 additions & 0 deletions pause().java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    public void test_LambdaTest_pause_demo() {
    driver.navigate().to("https://www.google.com/");
    driver.manage().window().maximize();

    try {
    Actions action = new Actions(driver);
    WebElement inputBox = driver.findElement(By.name("q"));


    action.moveToElement(inputBox)
    .click()
    .pause(Duration.ofSeconds(2))
    .sendKeys("Selenium 4")
    .build()
    .perform();
    } catch (Exception e) {
    System.out.println(e.getMessage());
    }
    }