public bool IsVisible(Enumerations.ControlWait controlWait = Enumerations.ControlWait.Average) { Stopwatch Timer = new Stopwatch(); Timer.Start(); // Waiting for Timeout defined in the ControlWait property while (!(broswerDriver.FindElements(findelement).Count > 0) && Timer.ElapsedMilliseconds < (int)controlWait * 1000) { } if (broswerDriver.FindElements(findelement).Count > 0) { return(true); } return(false); }
public bool WaitForControlVisible(Enumerations.ControlWait controlWait = Enumerations.ControlWait.Average) { Stopwatch Timer = new Stopwatch(); Timer.Start(); // Waiting for Timeout defined in the ControlWait property while (!ControlVisible() && Timer.ElapsedMilliseconds < (int)controlWait * 1000) { } if (ControlVisible()) { return(true); } else { throw new Exception("The Control " + findelement + "is not found for a timeout of Control wait - " + controlWait + " Secs waited - " + (int)controlWait); } }