private static string GetPropertyFromComputedStyle(this IWebElement element, ByProperty property) { var script = $"return window.getComputedStyle ? window.getComputedStyle(arguments[0], null).getPropertyValue('" + property.PropertyValue + "') : " + "null;"; var result = element.GetJsScriptExecutor().ExecuteScript(script, element).ToString(); return(result); }
private static string GetPropertyFromStyle(this IWebElement element, ByProperty property) { var driver = element.GetWebDriver(); var script = $"return arguments[0].style." + property.PropertyValue + "; "; var result = element.GetJsScriptExecutor().ExecuteScript(script, element).ToString(); return(result); }
/// <summary> /// Gets the element properties. /// </summary> /// <param name="element">The element.</param> /// <param name="property">The property.</param> /// <returns>Get webElement properties.</returns> private static dynamic GetElementProperties(this IWebElement element, ByProperty property) { return(element.GetJsScriptExecutor().ExecuteScript($"return arguments[0].{property.PropertyValue};", element)); }