Esempio n. 1
0
 @Test(
     description =
         "Verify that the values are successfully change/override by an administrator and attribute successfully saved",
     groups = {"Sanity"})
 public void ShutdownUpdate() throws Exception {
   action.RefreshPage();
   // Navigate to Configuration page, setting,SMGR, shutdown
   action.ClickLink(locator.getProperty("Configurations"));
   action.ClickLink(locator.getProperty("Settings"));
   action.ClickLink(locator.getProperty("SMGR"));
   action.ClickLink(locator.getProperty("Shutdown"));
   action.SwithchFrame("iframe0");
   action.ClickButton(locator.getProperty("Edit"));
   Accept = action.isAlertPresent();
   action.alert(Accept);
   action.WaitForTitle(locator.getProperty("Edit_Profile"));
   // update the value
   action.ClearText(locator.getProperty("Shutdown.GracePer"));
   // action.WaitForTitle(locator.getProperty("Edit_Profile"));
   action.ClearText(locator.getProperty("Shutdown.GracePer"));
   action.entertext(locator.getProperty("Shutdown.GracePer"), input.getProperty("number1"));
   // Verify that the values are successfully change/override by an administrator and attribute
   // successfully saved
   action.ClickButton(locator.getProperty("Commit"));
   Thread.sleep(2000);
   Accept = action.isAlertPresent();
   action.alert(Accept);
   action.VerifyElementValue(
       locator.getProperty("Shutdown.GracePer"), input.getProperty("number1"));
   Accept = action.isAlertPresent();
   action.alert(Accept);
 }
  @Test(description = "Restore Secondary server to primary", priority = 1)
  public void Restore() throws Exception {

    // Navigate to Geographic_Redundancy
    action.ClickLink(locator.getProperty("Geographic_Redundancy"));
    action.WaitForTitle(locator.getProperty("Geographic_Redundancy"));
    action.SwithchFrame("iframe0");
    // Click on Restore button
    action.ClickButton(locator.getProperty("GeoRestore"));
    Thread.sleep(3000);
    // Focus on Popup window
    WebElement Details = action.driver.findElement(By.xpath(locator.getProperty("RecoveryWindow")));
    Details.sendKeys(org.openqa.selenium.Keys.CONTROL);
    // Click on Recondary sever button
    action.ClickButton(locator.getProperty("RecoverSecondary"));
    WebElement recovercnfm =
        action.driver.findElement(By.xpath(locator.getProperty("RecoveryWindowcnfrm")));
    recovercnfm.sendKeys(org.openqa.selenium.Keys.CONTROL);
    // Click on OK button to confirm
    action.ClickButton(locator.getProperty("Restorecnfrm"));
    // Wait for some time to handle pop up
    Thread.sleep(550000);
    // handle alert
    if (action.isAlertPresent()) {
      action.driver.switchTo().alert();
      action.driver.switchTo().alert().accept();
    }
    // Wait for 15 minutes
    action.RefreshPage();
    Thread.sleep(150000);
    action.RefreshPage();
    WebDriverWait wait = new WebDriverWait(action.driver, 240000);
    wait.until(ExpectedConditions.titleContains(locator.getProperty("System_Manager")));
    action.RefreshPage();
    Thread.sleep(1000);
    WebElement ele = action.driver.findElement(By.xpath(locator.getProperty("ErrorBox")));
    while (ele.isDisplayed()) {
      action.RefreshPage();
      Thread.sleep(60000);
    }

    action.driver.quit();
    action.login(input.getProperty("UserId"), input.getProperty("Password"), action);
    Thread.sleep(1000);
    action.RefreshPage();
  }