Skip to content

Instantly share code, notes, and snippets.

@pieceofquality
Created September 5, 2016 04:29
Show Gist options
  • Save pieceofquality/858dd2035e36683954cef617e7f31d07 to your computer and use it in GitHub Desktop.
Save pieceofquality/858dd2035e36683954cef617e7f31d07 to your computer and use it in GitHub Desktop.
package com.pieceofquality.addressbook.appmanager;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class NavigationHelper extends HelperBase{
private WebDriver wd;
public NavigationHelper(WebDriver wd) {
super(wd);
}
public void gotoGroupPage() {
if (isElementPresent(By.tagName("h1"))
&& wd.findElement(By.tagName("h1")).getText().equals("Groups")
&& isElementPresent(By.name("new"))) {
return;
}
click(By.linkText("groups"));
}
public void returnToHomePage() {
click(By.linkText("home page"));
}
public void goToHomePage(){
if (isElementPresent(By.id("maintable"))){
return;
}
click(By.linkText("home"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment