コード例 #1
0
        public static IWebDriver SetupTimeout(this IWebDriver webDriver,
                                              double ScriptExecuteTimeoutSeconds,
                                              double PageLoadTimeoutSeconds)
        {
            Contract.Assert(webDriver != null, "The web driver cannot be null.");
            Contract.Assert(ScriptExecuteTimeoutSeconds >= 0, "The script execute timeout is invalid.");
            Contract.Assert(PageLoadTimeoutSeconds >= 0, "The page load timeout is invalid.");

            ITimeouts timeouts = webDriver.Manage().Timeouts();

            if (timeouts != null)
            {
                timeouts.SetScriptTimeout(TimeSpan.FromSeconds(ScriptExecuteTimeoutSeconds));
                timeouts.SetPageLoadTimeout(TimeSpan.FromSeconds(PageLoadTimeoutSeconds));
            }

            return(webDriver);
        }
コード例 #2
0
 public ITimeouts SetPageLoadTimeout(TimeSpan timeToWait)
 {
     return(_timeouts.SetPageLoadTimeout(timeToWait).ToWrapper());
 }
コード例 #3
0
 public TimeoutsInstance SetPageLoadTimeout(int timeToWait)
 {
     return(new TimeoutsInstance(this.Engine.Object.InstancePrototype, m_timeouts.SetPageLoadTimeout(TimeSpan.FromMilliseconds(timeToWait))));
 }