Ejemplo n.º 1
0
  // PAGE OBJECT METHODS
  public void waitTillFeaturedPageIsDisplayed() throws Exception {
    Reporter.log(
        "Invoke Application: " + System.getProperty("AppName") + " to display Featured Page..");

    SeleniumFunctions.isElementPresent(driver, By.id(loginButton), 60);
    SeleniumFunctions.isElementPresent(driver, By.id(Search_Btn), 30);
  }
Ejemplo n.º 2
0
  public void logoutUser(boolean reportStep) throws Exception {
    if (reportStep) {
      Reporter.log("Log out User.");
    }

    if (SeleniumFunctions.isElementPresent(driver, By.id(tvProviderLogo), 10)) {
      SeleniumFunctions.click(driver, By.id(tvProviderLogo));
      SeleniumFunctions.click(driver, By.id(yesButton));
      SeleniumFunctions.waitTillElementIsDisplayed(driver, By.name("Log out successfull"), 15);
    }
  }
Ejemplo n.º 3
0
 public String getVersionNumber() throws Exception {
   boolean flag;
   String versionNumber = "";
   SeleniumFunctions.isElementPresent(driver, By.id(moreButton), 60);
   SeleniumFunctions.click(driver, By.id(moreButton));
   try {
     flag = SeleniumFunctions.isElementPresent(driver, By.name("More"), 30);
     if (flag) {
       SeleniumFunctions.click(driver, By.name("More"));
       versionNumber = SeleniumFunctions.getText(driver, By.id(versionNumberLabel));
       if (SeleniumFunctions.getText(driver, By.id(wifiButton)).toLowerCase().contains("on")) {
         SeleniumFunctions.click(driver, By.id(wifiButton));
       }
       driver.navigate().back();
       Thread.sleep(1000);
     }
   } catch (InterruptedException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   return versionNumber;
 }
Ejemplo n.º 4
0
 public void navigateToFeaturedPage() {
   int i = 0;
   boolean flag = false;
   while (flag == false) {
     try {
       flag = SeleniumFunctions.isElementPresent(driver, By.id(featuredPage), 15);
       if (flag) {
         SeleniumFunctions.click(driver, By.id(featuredPage));
         break;
       } else {
         i = i + 1;
         driver.navigate().back();
       }
       if (i > 5) {
         Assert.fail("Unable to navigate to Featured Page");
         break;
       }
     } catch (InterruptedException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
     }
   }
 }