Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created April 11, 2024 07:19
Show Gist options
  • Save SarahElson/596ebb05fe3bdd27563b968f27c186cd to your computer and use it in GitHub Desktop.
Save SarahElson/596ebb05fe3bdd27563b968f27c186cd to your computer and use it in GitHub Desktop.
How To Retry Failed Tests Using IRetryAnalyzer In TestNG
public class HomePage {
public SearchResultPage searchProduct (final String productName) {
enterText (searchBox (), productName);
searchButton ().click ();
return new SearchResultPage ();
}
private WebElement searchBox () {
return getDriver ().findElement (By.name ("search"));
}
private WebElement searchButton () {
return getDriver ().findElement (By.cssSelector (".search-button"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment