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; } }
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; } }
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; } }
protected void WaitElementIsVisibled(IWebElement element, int?timeoutInmilliseconds = null) { _waitManager.WaitElementIsVisibled(element, timeoutInmilliseconds); }