Skip to content

Instantly share code, notes, and snippets.

Created April 15, 2018 14:40
What would you like to do?
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
public class BadExample {
private WebDriver driver;
public BadExample(WebDriver driver) {
this.driver = driver;
public String clickElementAndGetText(String elementToClickId, String elementToReadId) {
// Click the element we want to click
// Wait until the element we want to get the text from is visible
WebDriverWait wait = new WebDriverWait(driver, 10);
// Get the text from our read element and return it
return driver.findElement(;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment