public static void Highlight(this IWebDriverExt driver, IWebElement iWebElement, int ms = 100) { try { var originalElementBorder = (string)driver.ExecuteJavaScript("return arguments[0].style.border", iWebElement); driver.ExecuteJavaScript("arguments[0].style.border='3px solid red'; return;", iWebElement); Thread.Sleep(ms); driver.ExecuteJavaScript("arguments[0].style.border='" + originalElementBorder + "'; return;", iWebElement); } catch (Exception) { } }
public static void WaitStaticDOM(this IWebDriverExt driver) { Func <bool> ready = () => driver.ExecuteJavaScript("return document.readyState").Equals("complete"); try { WaitHelper.SpinWait(ready, TimeSpan.FromSeconds(10), driver.WaitProfile.PollingInterval); } catch { } }