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 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 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 optimisation they both use this primitive.
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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Accept_Alert No1 No2557 No1 No3
Add_Cookie No1 No2557 No1 No3
Back No1 No2557 No1 No3
Close_Window No1 No2557 No1 No3
Delete_All_Cookies No1 No2557 No1 No3
Delete_Cookie No1 No2557 No1 No3
Delete_Session No1 No2557 No1 No3
Dismiss_Alert No1 No2557 No1 No3
Element_Clear No1 No2557 No1 No3
Element_Click No1 No2557 No1 No3
Element_Send_Keys No1 No2557 No1 No3
Execute_Async_Script No1 No2557 No1 No3
Execute_Script No1 No2557 No1 No3
Find_Element No1 No2557 No1 No3
Find_Element_From_Element No1 No2557 No1 No3
Find_Elements No1 No2557 No1 No3
Find_Elements_From_Element No1 No2557 No1 No3
Forward No1 No2557 No1 No3
Fullscreen_Window No1 No2557 No1 No3
Get_Active_Element No1 No2557 No1 No3
Get_Alert_Text No1 No2557 No1 No3
Get_All_Cookies No1 No2557 No1 No3
Get_Current_URL No1 No2557 No1 No3
Get_Element_Attribute No1 No2557 No1 No3
Get_Element_CSS_Value No1 No2557 No1 No3
Get_Element_Property No1 No2557 No1 No3
Get_Element_Rect No1 No2557 No1 No3
Get_Element_Tag_Name No1 No2557 No1 No3
Get_Element_Text No1 No2557 No1 No3
Get_Named_Cookie No1 No2557 No1 No3
Get_Page_Source No1 No2557 No1 No3
Get_Timeouts No1 No2557 No1 No3
Get_Title No1 No2557 No1 No3
Get_Window_Handle No1 No2557 No1 No3
Get_Window_Handles No1 No2557 No1 No3
Get_Window_Rect No1 No2557 No1 No3
Is_Element_Enabled No1 No2557 No1 No3
Is_Element_Selected No1 No2557 No1 No3
Maximize_Window No1 No2557 No1 No3
Minimize_Window No1 No2557 No1 No3
Navigate_To No1 No2557 No1 No3
New_Session No1 No2557 No1 No3
Perform_Actions No1 No2557 No1 No3
Refresh No1 No2557 No1 No3
Release_Actions No1 No2557 No1 No3
Send_Alert_Text No1 No2557 No1 No3
Set_Timeouts No1 No2557 No1 No3
Set_Window_Rect No1 No2557 No1 No3
Status No1 No2557 No1 No3
Switch_To_Frame No1 No2557 No1 No3
Switch_To_Parent_Frame No1 No2557 No1 No3
Switch_To_Window No1 No2557 No1 No3
Take_Element_Screenshot No1 No2557 No1 No3
Take_Screenshot No1 No2557 No1 No3
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Accept_Alert No1 No1 No2 No No1 No3 No4
Add_Cookie No1 No1 No2 No No1 No3 No4
Back No1 No1 No2 No No1 No3 No4
Close_Window No1 No1 No2 No No1 No3 No4
Delete_All_Cookies No1 No1 No2 No No1 No3 No4
Delete_Cookie No1 No1 No2 No No1 No3 No4
Delete_Session No1 No1 No2 No No1 No3 No4
Dismiss_Alert No1 No1 No2 No No1 No3 No4
Element_Clear No1 No1 No2 No No1 No3 No4
Element_Click No1 No1 No2 No No1 No3 No4
Element_Send_Keys No1 No1 No2 No No1 No3 No4
Execute_Async_Script No1 No1 No2 No No1 No3 No4
Execute_Script No1 No1 No2 No No1 No3 No4
Find_Element No1 No1 No2 No No1 No3 No4
Find_Element_From_Element No1 No1 No2 No No1 No3 No4
Find_Elements No1 No1 No2 No No1 No3 No4
Find_Elements_From_Element No1 No1 No2 No No1 No3 No4
Forward No1 No1 No2 No No1 No3 No4
Fullscreen_Window No1 No1 No2 No No1 No3 No4
Get_Active_Element No1 No1 No2 No No1 No3 No4
Get_Alert_Text No1 No1 No2 No No1 No3 No4
Get_All_Cookies No1 No1 No2 No No1 No3 No4
Get_Current_URL No1 No1 No2 No No1 No3 No4
Get_Element_Attribute No1 No1 No2 No No1 No3 No4
Get_Element_CSS_Value No1 No1 No2 No No1 No3 No4
Get_Element_Property No1 No1 No2 No No1 No3 No4
Get_Element_Rect No1 No1 No2 No No1 No3 No4
Get_Element_Tag_Name No1 No1 No2 No No1 No3 No4
Get_Element_Text No1 No1 No2 No No1 No3 No4
Get_Named_Cookie No1 No1 No2 No No1 No3 No4
Get_Page_Source No1 No1 No2 No No1 No3 No4
Get_Timeouts No1 No1 No2 No No1 No3 No4
Get_Title No1 No1 No2 No No1 No3 No4
Get_Window_Handle No1 No1 No2 No No1 No3 No4
Get_Window_Handles No1 No1 No2 No No1 No3 No4
Get_Window_Rect No1 No1 No2 No No1 No3 No4
Is_Element_Enabled No1 No1 No2 No No1 No3 No4
Is_Element_Selected No1 No1 No2 No No1 No3 No4
Maximize_Window No1 No1 No2 No No1 No3 No4
Minimize_Window No1 No1 No2 No No1 No3 No4
Navigate_To No1 No1 No2 No No1 No3 No4
New_Session No1 No1 No2 No No1 No3 No4
Perform_Actions No1 No1 No2 No No1 No3 No4
Refresh No1 No1 No2 No No1 No3 No4
Release_Actions No1 No1 No2 No No1 No3 No4
Send_Alert_Text No1 No1 No2 No No1 No3 No4
Set_Timeouts No1 No1 No2 No No1 No3 No4
Set_Window_Rect No1 No1 No2 No No1 No3 No4
Status No1 No1 No2 No No1 No3 No4
Switch_To_Frame No1 No1 No2 No No1 No3 No4
Switch_To_Parent_Frame No1 No1 No2 No No1 No3 No4
Switch_To_Window No1 No1 No2 No No1 No3 No4
Take_Element_Screenshot No1 No1 No2 No No1 No3 No4
Take_Screenshot No1 No1 No2 No No1 No3 No4

1. To enable Chromium support, include {"goog:chromeOptions": {"w3c": true}} in the capabiliites when running the command.

2. The vendor-supported implementation for Edge is non-spec-conforming and incompatible.

3. The vendor-supported implementation for Safari is non spec-conforming and incompatible.

4. The vendor-supported implementation for Samsung Internet is non-spec-conforming and incompatible.

Document Tags and Contributors

 Contributors to this page: ExE_Boss, chrisdavidmills
 Last updated by: ExE-Boss,