Пример #1
0
 public void AcceptAlert(int?timeoutInmilliseconds = null)
 {
     _waitManager.WaitAlertIsPresented(timeoutInmilliseconds);
     _logger.LogInfo("Accept Browser Alert");
     try
     {
         _driver.SwitchTo().Alert().Accept();
     }
     catch (Exception e)
     {
         _logger.LogError(e.ToString());
         throw;
     }
 }
Пример #2
0
 public string GetAlertText(int?timeoutInmilliseconds = null)
 {
     _waitManager.WaitAlertIsPresented(timeoutInmilliseconds);
     _logger.LogInfo(string.Format("Get text from Alert"));
     try
     {
         string text = _driver.SwitchTo().Alert().Text;
         _logger.LogInfo(string.Format("Text [{0}] get", text));
         return(text);
     }
     catch (Exception e)
     {
         _logger.LogError(e.ToString());
         throw;
     }
 }
Пример #3
0
 protected void WaitAlertIsPresented(int?timeoutInmilliseconds = null)
 {
     _waitManager.WaitAlertIsPresented(timeoutInmilliseconds);
 }