protected virtual void OnNavigatingBack(WebDriverNavigationEventArgs e)
 {
     if (this.NavigatingBack != null)
     {
         this.NavigatingBack(this, e);
     }
 }
Пример #2
0
 private void Navigated(object sender, WebDriverNavigationEventArgs e)
 {
     foreach (var pageLoadHandler in _everyPageLoad)
     {
         pageLoadHandler.Execute(e.Url);
     }
 }
Пример #3
0
            /// <summary>
            /// Move the browser back
            /// </summary>
            public void Back()
            {
                WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver);

                this.parentDriver.OnNavigatingBack(e);
                this.wrappedNavigation.Back();
                this.parentDriver.OnNavigatedBack(e);
            }
Пример #4
0
            /// <summary>
            /// Move the browser forward
            /// </summary>
            public void Forward()
            {
                WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver);

                this.parentDriver.OnNavigatingForward(e);
                this.wrappedNavigation.Forward();
                this.parentDriver.OnNavigatedForward(e);
            }
Пример #5
0
            /// <summary>
            /// Navigate to a url for your test
            /// </summary>
            /// <param name="url">String of where you want the browser to go to</param>
            public void GoToUrl(string url)
            {
                WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver, url);

                this.parentDriver.OnNavigating(e);
                this.wrappedNavigation.GoToUrl(url);
                this.parentDriver.OnNavigated(e);
            }
Пример #6
0
 private void driver_Navigating(object sender, WebDriverNavigationEventArgs e)
 {
     Common.Delay(Config.Settings.runTimeSettings.CommandDelayMs);
     if (Config.Settings.reportSettings.commandLogging)
     {
         TestBase.LogEvent(string.Format("Navigating to url {0}", e.Url));
     }
 }
Пример #7
0
            /// <summary>
            /// Navigate to a url for your test
            /// </summary>
            /// <param name="url">Uri object of where you want the browser to go to</param>
            public void GoToUrl(Uri url)
            {
                if (url == null)
                {
                    throw new ArgumentNullException("url", "url cannot be null");
                }

                WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver, url.ToString());

                this.parentDriver.OnNavigating(e);
                this.wrappedNavigation.GoToUrl(url);
                this.parentDriver.OnNavigated(e);
            }
 public void Forward()
 {
     try
     {
         WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver);
         this.parentDriver.OnNavigatingForward(e);
         this.wrappedNavigation.Forward();
         this.parentDriver.OnNavigatedForward(e);
     }
     catch (Exception thrownException)
     {
         this.parentDriver.OnException(new WebDriverExceptionEventArgs(this.parentDriver, thrownException));
         throw;
     }
 }
 public void GoToUrl(string url)
 {
     try
     {
         WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver, url);
         this.parentDriver.OnNavigating(e);
         this.wrappedNavigation.GoToUrl(url);
         this.parentDriver.OnNavigated(e);
     }
     catch (Exception thrownException)
     {
         this.parentDriver.OnException(new WebDriverExceptionEventArgs(this.parentDriver, thrownException));
         throw;
     }
 }
Пример #10
0
 /// <summary>
 /// Navigate to a url for your test
 /// </summary>
 /// <param name="url">String of where you want the browser to go to</param>
 public void GoToUrl(string url)
 {
     try
     {
         WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver, url);
         this.parentDriver.OnNavigating(e);
         this.wrappedNavigation.GoToUrl(url);
         this.parentDriver.OnNavigated(e);
     }
     catch (Exception ex)
     {
         this.parentDriver.OnException(new WebDriverExceptionEventArgs(this.parentDriver, ex));
         throw;
     }
 }
Пример #11
0
 /// <summary>
 /// Move the browser forward
 /// </summary>
 public void Forward()
 {
     try
     {
         WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver);
         this.parentDriver.OnNavigatingForward(e);
         this.wrappedNavigation.Forward();
         this.parentDriver.OnNavigatedForward(e);
     }
     catch (Exception ex)
     {
         this.parentDriver.OnException(new WebDriverExceptionEventArgs(this.parentDriver, ex));
         throw;
     }
 }
 private static void Navigated(object sender, WebDriverNavigationEventArgs e)
 {
     TestWebDriver.LogMessage(LogLevel.Verbose, $"Navigating to [{e.Url}]");
 }
 /// <summary>
 /// Navigate to a url for your test
 /// 
 /// </summary>
 /// <param name="url">Uri object of where you want the browser to go to</param>
 public void GoToUrl(Uri url)
 {
   if (url == (Uri) null)
     throw new ArgumentNullException("url", "url cannot be null");
   try
   {
     WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs((IWebDriver) this.parentDriver, url.ToString());
     this.parentDriver.OnNavigating(e);
     this.wrappedNavigation.GoToUrl(url);
     this.parentDriver.OnNavigated(e);
   }
   catch (Exception ex)
   {
     this.parentDriver.OnException(new WebDriverExceptionEventArgs((IWebDriver) this.parentDriver, ex));
     throw;
   }
 }
 /// <summary>
 ///     Raises the <see cref="E:OpenQA.Selenium.Support.Events.EventFiringWebDriver.NavigatingForward" /> event.
 /// </summary>
 /// <param name="e">
 ///     A <see cref="T:OpenQA.Selenium.Support.Events.WebDriverNavigationEventArgs" /> that contains the event
 ///     data.
 /// </param>
 protected virtual void OnNavigatingForward(WebDriverNavigationEventArgs e)
 {
     if (NavigatingForward == null)
         return;
     NavigatingForward(this, e);
 }
Пример #15
0
 /// <summary>
 /// Raises the <see cref="NavigatingBack"/> event.
 /// </summary>
 /// <param name="e">A <see cref="WebDriverNavigationEventArgs"/> that contains the event data.</param>
 protected virtual void OnNavigatingBack(WebDriverNavigationEventArgs e)
 {
     if (this.NavigatingBack != null)
     {
         this.NavigatingBack(this, e);
     }
 }
 void firingDriver_NavigatedBack(object sender, WebDriverNavigationEventArgs e)
 {
     log.AppendLine("Navigated back");
 }
Пример #17
0
 /// <summary>
 /// Navigate to a url for your test
 /// </summary>
 /// <param name="url">String of where you want the browser to go to</param>
 public void GoToUrl(string url)
 {
     WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver, url);
     this.parentDriver.OnNavigating(e);
     this.wrappedNavigation.GoToUrl(url);
     this.parentDriver.OnNavigated(e);
 }
Пример #18
0
 /// <summary>
 /// Move the browser back
 /// </summary>
 public void Back()
 {
     WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver);
     this.parentDriver.OnNavigatingBack(e);
     this.wrappedNavigation.Back();
     this.parentDriver.OnNavigatedBack(e);
 }
Пример #19
0
            public void GoToUrl(Uri url, string username, string password)
            {
                if (url == null)
                {
                    throw new ArgumentNullException("url", "url cannot be null");
                }

                if (url == null)
                {
                    throw new ArgumentNullException("username", "username cannot be null");
                }

                if (url == null)
                {
                    throw new ArgumentNullException("password", "password cannot be null");
                }

                try
                {
                    WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver, url.ToString());
                    this.parentDriver.OnNavigating(e);
                    this.wrappedNavigation.GoToUrl(url, username, password);
                    this.parentDriver.OnNavigated(e);
                }
                catch (Exception ex)
                {
                    this.parentDriver.OnException(new WebDriverExceptionEventArgs(this.parentDriver, ex));
                    throw;
                }
            }
 private void OnNavigated(object sender, WebDriverNavigationEventArgs webDriverNavigationEventArgs)
 {
     SeleniumLog log = SeleniumLog.Instance();
     if (log.Config.OnNavigating_LogAfterEvent)
     {
         //log.SaveIndent("OnNavigated");
         log.Indent();
         log.WriteLine("[Selenium Event]  Navigation Success!", take_screenshot: log.Config.OnNavigating_TakeScreenshotBeforeEvent);
         //log.RestoreIndent("OnNavigated");
         log.Unindent();
     }
 }
 private void OnNavigatingForward(object sender, WebDriverNavigationEventArgs webDriverNavigationEventArgs)
 {
     SeleniumLog log = SeleniumLog.Instance();
     if (log.Config.OnNavigatingForward_LogBeforeEvent)
     {
         log.Indent();
         log.WriteLine("[Selenium Event]  Navigating Forward: " + webDriverNavigationEventArgs.Url, take_screenshot: log.Config.OnNavigatingForward_TakeScreenshotBeforeEvent);
         log.Unindent();
     }
 }
 private void OnNavigatedForward(object sender, WebDriverNavigationEventArgs webDriverNavigationEventArgs)
 {
     SeleniumLog log = SeleniumLog.Instance();
     if (log.Config.OnNavigatingForward_LogAfterEvent)
     {
         log.Indent();
         log.WriteLine("[Selenium Event]  Navigate Forward Success!", take_screenshot: log.Config.OnNavigatingForward_TakeScreenshotAfterEvent);
         log.Unindent();
     }
 }
Пример #23
0
 public static void Navigating(object sender, WebDriverNavigationEventArgs e)
 {
     Console.WriteLine("Will navigate to " + e.Url);
 }
 void testDriver_Navigating(object sender, WebDriverNavigationEventArgs e)
 {
     Assert.AreEqual(e.Driver, mockDriver);
 }
 void firingDriver_Navigated(object sender, WebDriverNavigationEventArgs e)
 {
     log.Append("Navigated ").Append(e.Url).AppendLine();
 }
Пример #26
0
 void testDriver_Navigating(object sender, WebDriverNavigationEventArgs e)
 {
     Assert.AreEqual(e.Driver, stubDriver);
 }
 void firingDriver_NavigatedForward(object sender, WebDriverNavigationEventArgs e)
 {
     log.AppendLine("Navigated forward");
 }
Пример #28
0
 void firingDriver_NavigatedBack(object sender, WebDriverNavigationEventArgs e)
 {
     log.AppendLine("Navigated back");
 }
Пример #29
0
 /// <summary>
 /// Raises the <see cref="NavigatingForward"/> event.
 /// </summary>
 /// <param name="e">A <see cref="WebDriverNavigationEventArgs"/> that contains the event data.</param>
 protected virtual void OnNavigatingForward(WebDriverNavigationEventArgs e)
 {
     if (this.NavigatingForward != null)
     {
         this.NavigatingForward(this, e);
     }
 }
 /// <summary>
 ///     Raises the <see cref="E:OpenQA.Selenium.Support.Events.EventFiringWebDriver.NavigatedBack" /> event.
 /// </summary>
 /// <param name="e">
 ///     A <see cref="T:OpenQA.Selenium.Support.Events.WebDriverNavigationEventArgs" /> that contains the event
 ///     data.
 /// </param>
 protected virtual void OnNavigatedBack(WebDriverNavigationEventArgs e)
 {
     if (NavigatedBack == null)
         return;
     NavigatedBack(this, e);
 }
Пример #31
0
 /// <summary>
 /// Move the browser forward
 /// </summary>
 public void Forward()
 {
     WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver);
     this.parentDriver.OnNavigatingForward(e);
     this.wrappedNavigation.Forward();
     this.parentDriver.OnNavigatedForward(e);
 }
 /// <summary>
 /// Raises the <see cref="E:Navigating" /> event.
 /// </summary>
 /// <param name="e">The <see cref="WebDriverNavigationEventArgs"/> instance containing the event data.</param>
 protected override void OnNavigating(WebDriverNavigationEventArgs e)
 {
     Logger.Trace(CultureInfo.CurrentCulture, "Navigating to: {0}", e.Url);
     base.OnNavigating(e);
 }
Пример #33
0
            /// <summary>
            /// Navigate to a url for your test
            /// </summary>
            /// <param name="url">Uri object of where you want the browser to go to</param>
            public void GoToUrl(Uri url)
            {
                if (url == null)
                {
                    throw new ArgumentNullException("url", "url cannot be null");
                }

                WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs(this.parentDriver, url.ToString());
                this.parentDriver.OnNavigating(e);
                this.wrappedNavigation.GoToUrl(url);
                this.parentDriver.OnNavigated(e);
            }
 /// <summary>
 /// Raises the <see cref="E:OpenQA.Selenium.Support.Events.EventFiringWebDriver.NavigatingBack"/> event.
 /// 
 /// </summary>
 /// <param name="e">A <see cref="T:OpenQA.Selenium.Support.Events.WebDriverNavigationEventArgs"/> that contains the event data.</param>
 protected virtual void OnNavigatingBack(WebDriverNavigationEventArgs e)
 {
   if (this.NavigatingBack == null)
     return;
   this.NavigatingBack((object) this, e);
 }
Пример #35
0
 void firingDriver_Navigated(object sender, WebDriverNavigationEventArgs e)
 {
     log.Append("Navigated ").Append(e.Url).AppendLine();
 }
 /// <summary>
 /// Raises the <see cref="E:OpenQA.Selenium.Support.Events.EventFiringWebDriver.NavigatedForward"/> event.
 /// 
 /// </summary>
 /// <param name="e">A <see cref="T:OpenQA.Selenium.Support.Events.WebDriverNavigationEventArgs"/> that contains the event data.</param>
 protected virtual void OnNavigatedForward(WebDriverNavigationEventArgs e)
 {
   if (this.NavigatedForward == null)
     return;
   this.NavigatedForward((object) this, e);
 }
Пример #37
0
 void firingDriver_NavigatedForward(object sender, WebDriverNavigationEventArgs e)
 {
     log.AppendLine("Navigated forward");
 }
 /// <summary>
 /// Move the browser back
 /// 
 /// </summary>
 public void Back()
 {
   try
   {
     WebDriverNavigationEventArgs e = new WebDriverNavigationEventArgs((IWebDriver) this.parentDriver);
     this.parentDriver.OnNavigatingBack(e);
     this.wrappedNavigation.Back();
     this.parentDriver.OnNavigatedBack(e);
   }
   catch (Exception ex)
   {
     this.parentDriver.OnException(new WebDriverExceptionEventArgs((IWebDriver) this.parentDriver, ex));
     throw;
   }
 }