public String stExternalEmailGoogleLogin(int dataId,int ExpVal,String flow )
    {
          int actVal=1000;
          String returnVal=null;
          hm.clear();
    
    hm=STFunctionLibrary.stMakeData(dataId, "Login");
    String emailadrs = hm.get("EmailAddress");            
    String password = hm.get("Password");
    String confirmationtitle = hm.get("LoginConfirmationTitle");
    STCommonLibrary comLib=new STCommonLibrary();
    
    String stNewWindowTitle = null;
    
    
    Vector<String> xPath=new Vector<String>();
    Vector<String> errorMsg=new Vector<String>();
    
    try 
    {
          xPath.add(SIGNIN_GOOGLE_USERNAME);
          errorMsg.add("Username field on Google page not present");
    
          comLib.stVerifyObjects(xPath, errorMsg, flow); 
          
          xPath.clear();
          errorMsg.clear();
    
  Block:
  {	    
      
    /*Typing username and Password*/
    if(!"".equals(emailadrs))
    {
          browser.focus(SIGNIN_GOOGLE_USERNAME);
          browser.click(SIGNIN_GOOGLE_USERNAME);
                try {
                      Thread.sleep(3000);
                } catch (InterruptedException e) {
                      e.printStackTrace();
                }
                
          browser.type(SIGNIN_GOOGLE_USERNAME, emailadrs );
          
    }
    
    if(!"".equals(password))
    {
          browser.focus(SIGNIN_GOOGLE_PASSWORD);
                browser.click(SIGNIN_GOOGLE_PASSWORD);
          
                try {
                      Thread.sleep(3000);
                } catch (InterruptedException e) {
                      e.printStackTrace();
                }
          browser.type(SIGNIN_GOOGLE_PASSWORD, password );                                                                      
    }
    
    /*Verify the Sign in Button */
    xPath.add(SIGNIN_GOOGLE_SIGNIN_BUTTON);
    errorMsg.add("Sign in Button is not present on Google Sign-in page");    
    comLib.stVerifyObjects(xPath, errorMsg, "STOP");
    
    xPath.clear();
    errorMsg.clear();
    
          /*Click on Sign in Button */
    
          browser.click(SIGNIN_GOOGLE_SIGNIN_BUTTON);
          
          try {
               Thread.sleep(60000);
          } catch (InterruptedException e) {
              e.printStackTrace();
          }     
          
    
    String allwindowtitle [] = browser.getAllWindowTitles();
    int numberOfwindows= allwindowtitle.length;
    System.out.println(" No of open windows= " + numberOfwindows);
    
    /* Fetching Window Title */
    stNewWindowTitle = browser.getTitle();
    System.out.println(stNewWindowTitle);
    
    /* Selecting the native window */
    if (numberOfwindows <= 2)
    {
          browser.selectWindow(stNewWindowTitle);
    }else 
    	/* Breaking the block if there's an error on Google Sign in Window */
    {
          actVal = 3; /* Unknown error occurred on Google Sign in page */   
          break Block;
    }    
    
    if(stNewWindowTitle.contains(confirmationtitle))
    {
        actVal= 0; /* Sign in successful with given username */
        break Block;
    }
    else
    {
        actVal= 1; /* Username is incorrect */
        break Block;
    } 
    	
   	}          
    }
          catch (SeleniumException sexp)
          {
              Reporter.log(sexp.getMessage());   
          } 
    returnVal=STFunctionLibrary.stRetValDes(ExpVal, actVal, "stExternalEmailGoogleLogin",flow, hm);    
    if(flow.contains("STOP"))
    {
          assertEquals("PASS",returnVal);
    }
    
    return returnVal;
    }