Table of Contents

Interface INavigation

Namespace
OpenQA.Selenium
Assembly
WebDriver.dll

Defines an interface allowing the user to access the browser's history and to navigate to a given URL.

public interface INavigation

Methods

Back()

Move back a single entry in the browser's history.

void Back()

BackAsync()

Move back a single entry in the browser's history as an asynchronous task.

Task BackAsync()

Returns

Task

A task object representing the asynchronous operation.

Forward()

Move a single "item" forward in the browser's history.

void Forward()

Remarks

Does nothing if we are on the latest page viewed.

ForwardAsync()

Move a single "item" forward in the browser's history as an asynchronous task.

Task ForwardAsync()

Returns

Task

A task object representing the asynchronous operation.

GoToUrl(string)

Load a new web page in the current browser window.

void GoToUrl(string url)

Parameters

url string

The URL to load. It is best to use a fully qualified URL

Remarks

Calling the GoToUrl(string) method will load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete. This will follow redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until this timeout is over, since should the underlying page change while your test is executing the results of future calls against this interface will be against the freshly loaded page.

GoToUrl(Uri)

Load a new web page in the current browser window.

void GoToUrl(Uri url)

Parameters

url Uri

The URL to load.

Remarks

Calling the GoToUrl(Uri) method will load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete. This will follow redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until this timeout is over, since should the underlying page change while your test is executing the results of future calls against this interface will be against the freshly loaded page.

GoToUrlAsync(string)

Navigate to a url as an asynchronous task.

Task GoToUrlAsync(string url)

Parameters

url string

String of where you want the browser to go.

Returns

Task

A task object representing the asynchronous operation.

GoToUrlAsync(Uri)

Navigate to a url as an asynchronous task.

Task GoToUrlAsync(Uri url)

Parameters

url Uri

Uri object of where you want the browser to go.

Returns

Task

A task object representing the asynchronous operation.

Refresh()

Refreshes the current page.

void Refresh()

RefreshAsync()

Reload the current page as an asynchronous task.

Task RefreshAsync()

Returns

Task

A task object representing the asynchronous operation.