private static object ExecuteScript(string script, By locator, int index = 0) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, script, locator); return(((IJavaScriptExecutor)DriverSingleton.Driver).ExecuteScript( script, DriverSingleton.Driver.FindElements(locator)[index])); }
public string GetCssValue(By locator, string propertyName) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); return(DriverSingleton.Driver.FindElement(locator).GetCssValue(propertyName)); }
public bool IsLinkActive(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); return(DriverSingleton.Driver.FindElement(locator).GetCssValue("cursor").Equals("pointer")); }
public string GetValue(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); return(JsExecutor.Value(locator)); }
public string GetTextByJs(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); return(JsExecutor.InnerText(locator)); }
private static void ExecuteScript(string script, IWebElement element) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, script, element); ((IJavaScriptExecutor)DriverSingleton.Driver).ExecuteScript(script, element); LoggerSelenium.LogEnd(MethodBase.GetCurrentMethod().Name, script, element); }
public string GetAttribute(By locator, string attributeName, int index = 0) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator, attributeName, index); Wait.StandardWait(); return(DriverSingleton.Driver.FindElements(locator)[index].GetAttribute(attributeName)); }
public ReadOnlyCollection <IWebElement> FindElements(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); return(DriverSingleton.Driver.FindElements(locator)); }
public ReadOnlyCollection <IWebElement> FindElementsInReport(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); Wait.ForRollerOnReportsToGoAway(); return(this.FindElements(locator)); }
public string GetText(By locator, int index = 0) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); Wait.ForRollerOnReportsToGoAway(); return(DriverSingleton.Driver.FindElements(locator)[index].Text); }
public bool IsElementPresent(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); Wait.StandardWait(); try { DriverSingleton.Driver.FindElement(locator); return(true); } catch (NoSuchElementException) { return(false); } }
public static string GetCurrentUrl() { LoggerSelenium.LogReturn(System.Reflection.MethodBase.GetCurrentMethod().Name); return(DriverSingleton.Driver.Url); }
public static string InnerText(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); return((string)ExecuteScript("return arguments[0].innerText.trim()", locator)); }
public static bool DocumentComplete() { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name); return(ExecuteScript("return document.readyState").Equals("complete")); }
public static bool Disabled(By locator, int index = 0) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator, index); return(ExecuteScript($"return arguments[0].disabled", locator, index).Equals(true)); }
private static object ExecuteScript(string script) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, script); return(((IJavaScriptExecutor)DriverSingleton.Driver).ExecuteScript(script)); }
public static string Value(By locator) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator); return((string)ExecuteScript("return arguments[0].value", locator)); }
private static WebDriverWait SetWaitTime(int milliseconds) { LoggerSelenium.LogReturn(System.Reflection.MethodBase.GetCurrentMethod().Name, milliseconds); return(new WebDriverWait(DriverSingleton.Driver, TimeSpan.FromMilliseconds(milliseconds))); }
public bool DisabledByJs(By locator, int index = 0) { LoggerSelenium.LogReturn(MethodBase.GetCurrentMethod().Name, locator, index); return(JsExecutor.Disabled(locator, index)); }