Exemple #1
0
        public void MoveMouseToElement(IWebElement element, int?timeoutInmilliseconds = null)
        {
            _waitManager.WaitElementIsVisibled(element, timeoutInmilliseconds);
            var action = new Actions(_driver);

            _logger.LogInfo(string.Format("Perform move mouse to element [{0}] ", element));
            try
            {
                action.MoveToElement(element);
            }
            catch (Exception e)
            {
                _logger.LogError(e.ToString());
                throw;
            }
        }
Exemple #2
0
 public void ScrollToElement(IWebElement element, int?timeoutInmilliseconds = null)
 {
     _waitManager.WaitPageLoadReady(timeoutInmilliseconds);
     _waitManager.WaitElementIsVisibled(element, timeoutInmilliseconds);
     _logger.LogInfo(string.Format("Scroll page to element [{0}]", element));
     try
     {
         IJavaScriptExecutor js = (IJavaScriptExecutor)_driver;
         js.ExecuteScript("arguments[0].scrollIntoView();", element);
     }
     catch (Exception e)
     {
         _logger.LogError(e.ToString());
         throw;
     }
 }
Exemple #3
0
 public string GetText(IWebElement element, int?timeoutInmilliseconds = null)
 {
     _waitManager.WaitElementIsVisibled(element, timeoutInmilliseconds);
     _logger.LogInfo(string.Format("Get text from element [{0}]", element));
     try
     {
         string text = element.Text;
         _logger.LogInfo(string.Format("Text [{0}] get", text));
         return(text);
     }
     catch (Exception e)
     {
         _logger.LogError(e.ToString());
         throw;
     }
 }
Exemple #4
0
 protected void WaitElementIsVisibled(IWebElement element, int?timeoutInmilliseconds = null)
 {
     _waitManager.WaitElementIsVisibled(element, timeoutInmilliseconds);
 }