Skip to content

Instantly share code, notes, and snippets.

@64lines
Created August 25, 2017 01:19
Show Gist options
  • Select an option

  • Save 64lines/61a210106722d51fb99b69f0c994e295 to your computer and use it in GitHub Desktop.

Select an option

Save 64lines/61a210106722d51fb99b69f0c994e295 to your computer and use it in GitHub Desktop.
/* Clicks an element */
driver.findElement(By.id("some-button")).click();
/* Write some text on the element */
driver.findElement(By.id("user-name")).sendKeys("Some text");
/* Clicks a link with the text "Download free" */
driver.findElement(By.linkText("Downwload free")).click();
/* Make it wait for some time until something you defined happens like the presence of an element */
(new WebDriverWait(driver, WAIT_SECONDS)).until(ExpectedConditions.presenceOfElementLocated(By.id("vote-for-prettiest-dog-button")));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment