public void IsPresent_Simple_False() { SetUp(); var element = new PageElement(By.TagName("nasdfav")); Assert.IsFalse(element.IsPresent()); }
/// <summary> /// Waits until the given PageElement is present before proceeding. /// </summary> /// <exception cref="StaticDriver.AwaitElementException">Exception that is thrown if the element is not present within the given wait time</exception> /// <param name="waitMilliseconds">Length of time to wait in milliseconds before throwin an exception</param> /// <param name="exceptionMessage">Exception message that will accompany the AwaitElementException if it is thrown.</param> public static void AwaitElement(PageElement element, int waitMilliseconds, string exceptionMessage = "The provided element was not present within the allotted time.") { var currentTime = DateTime.Now; var startTime = currentTime; while (currentTime.Subtract(startTime).TotalMilliseconds <= waitMilliseconds) { if (element.IsPresent(waitMilliseconds)) { return; } currentTime = DateTime.Now; } throw new AwaitElementException(exceptionMessage); }