public void ClearText(By by, int?timeoutInmilliseconds = null) { _waitManager.WaitElementIsClickabled(by, timeoutInmilliseconds); var element = _findManager.Find(by); _logger.LogInfo(string.Format("Perform clear text on element [{0}]", by)); try { element.Clear(); } catch (Exception e) { _logger.LogError(e.ToString()); throw; } }
public string GetText(By by, int?timeoutInmilliseconds = null) { _waitManager.WaitElementIsVisibled(by, timeoutInmilliseconds); var element = _findManager.Find(by); _logger.LogInfo(string.Format("Get text from element [{0}]", by)); try { string text = element.Text; _logger.LogInfo(string.Format("Text [{0}] get", text)); return(text); } catch (Exception e) { _logger.LogError(e.ToString()); throw; } }
public void ScrollToElement(By by, int?timeoutInmilliseconds = null) { _waitManager.WaitPageLoadReady(timeoutInmilliseconds); _waitManager.WaitElementIsVisibled(by, timeoutInmilliseconds); var element = _findManager.Find(by); _logger.LogInfo(string.Format("Scroll page to element [{0}]", by)); try { IJavaScriptExecutor js = (IJavaScriptExecutor)_driver; js.ExecuteScript("arguments[0].scrollIntoView();", element); } catch (Exception e) { _logger.LogError(e.ToString()); throw; } }
public void TryClick(By by) { _findManager.Find(by).Click(); }
protected IWebElement Find(By by) { return(_findManager.Find(by)); }