Tuesday, August 30, 2016

RecoveryScenarios

 package com.hr.generic;  
 import com.hr.automation.sahi.Button;  
 import com.hr.automation.sahi.Password;  
 import com.hr.automation.sahi.TextBox;  
 public class RecoveryScenarios extends DriverScript {  
 public boolean environmentDown()  
      {  
           return true;  
      }  
 public boolean someTechincalError()throws Throwable  
 {  
      browser.navigateTo(configProps.getProperty("URL"), true);  
      System.out.println("In someTechnicalError recovery");  
      return true;  
 }  
 public boolean unableToLoginWithCredentials() throws Throwable  
 {  
           Thread.sleep(10000);  
       browser.button("OK").click();  
       browser.navigateTo(configProps.getProperty("URL"), true);  
       if(TextBox.setText("username", configProps.getProperty("UserName"))==false)  
           {  
                return false;  
           }  
           if(Password.setPassword("password", configProps.getProperty("Password"))==false)  
           {  
                DriverScript.bResult = false;  
                return false;  
           }  
           if(Button.click("Submit")==false)  
           {  
                DriverScript.bResult = false;  
                return false;  
           }  
      return true;  
 }  
 public boolean singleUserLogin()throws Throwable  
      {  
           if(Button.click("OK")==false)  
           {  
                return false;       
           }  
           return true;  
      }  
 }  

1 comment:


  1. very useful info, and please keep updating........
    Thanks

    ReplyDelete