Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created April 11, 2024 05:23
Show Gist options
  • Save SarahElson/810739ce54283a6af3e37e1e6eb7acff to your computer and use it in GitHub Desktop.
Save SarahElson/810739ce54283a6af3e37e1e6eb7acff to your computer and use it in GitHub Desktop.
How To Retry Failed Tests Using IRetryAnalyzer In TestNG
public class HomePage {
public LoginPage navigateToLoginPage () {
openMyAccountMenu ().loginLink ()
.click ();
return new LoginPage ();
}
private HomePage openMyAccountMenu () {
getDriver ().findElement (By.linkText ("My account"))
.click ();
return this;
}
private WebElement loginLink () {
return getDriver ().findElement (By.linkText ("Login"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment