Commands

The following is a list of the available WebDriver commands.

Close Window

The Close Window command of the WebDriver API closes the current top-level browsing context (window or tab) and returns with the list of currently open WebWindows. If it is the last window that is being closed, the WebDriver session will implicitly be deleted. Subsequent commands after the session is ended will therefore cause invalid session ID errors.

Get Element Attribute

The Get Element Attribute command of the WebDriver API returns the attribute of the referenced web element. If for example the element is an img, the returned attribute is "//TODO", which is equivalent to calling Element.getAttribute on the element. For XML/XHTML documents it may be cased differently.

Get Element Property

The Get Element Property command of the WebDriver API returns the property of the referenced web element. Given <input value=foo> where the user changes the value to bar, the returned property is bar rather than the initial value foo. This is equivalent to calling Element.getProperty on the element.

Get Element Tag Name

The Get Element Tag Name command of the WebDriver API returns the tag name of the referenced web element. If for example the element is an img, the returned tag name is "IMG", which is equivalent to calling Element.tagName on the element. For XML/XHTML documents it may be cased differently.

Get Timeouts

The Get Timeouts command of the WebDriver API returns the timeouts associated with the current session. The session timeout durations control such behavior as timeouts on script injection, document navigation, and element retrieval.

Get Window Handles

The Get Window Handles command of the WebDriver API returns a list of all WebWindows. Each tab or window, depending on whether you are using a tabbed browser, is associated by a window handle that is used as a reference when switching to the window.

Get Window Rect

The Get Window Rect command of the WebDriver API returns the size and position of the given WebElement. Many WebDriver clients present separate API methods for getting an element's location and dimensions, but as an optimization they both use this primitive.

New Window

The New Window command of the WebDriver API opens a new top-level browsing context of type window or tab, and returns with a dictionary containing the handle of the new WebWindow and its created type. If the requested type cannot be created by the browser, the alternative type will be tried to create.

Set Timeouts

The Set Timeouts command of the WebDriver API sets the timeouts associated with the current session. The session timeout durations control such behavior as timeouts on script injection, document navigation, and element retrieval.

Set Window Rect

The Set Window Rect command of the WebDriver API alters the size and position of the operating system window associated with the current window. The command acts as the setter of Get Window Rect, which return object you can pass directly as this command's payload.

Browser compatibility

BCD tables only load in the browser