Skip to content

WebDriver Classic Protocol Reference

All HTTP endpoints from the WebDriver spec (editor’s draft).

61 commands total.


MethodURI TemplateCommandDescription
POST/sessionNew SessionCreates a new WebDriver session
DELETE/session/{session id}Delete SessionEnds the current session
GET/statusStatusReturns whether the remote end can create new sessions
MethodURI TemplateCommandDescription
GET/session/{session id}/timeoutsGet TimeoutsReturns the current session timeouts configuration
POST/session/{session id}/timeoutsSet TimeoutsSets the session timeout durations (script, pageLoad, implicit)
MethodURI TemplateCommandDescription
POST/session/{session id}/urlNavigate ToNavigates the current top-level browsing context to a URL
GET/session/{session id}/urlGet Current URLReturns the URL of the current page
POST/session/{session id}/backBackTraverses one step backward in the joint session history
POST/session/{session id}/forwardForwardTraverses one step forward in the joint session history
POST/session/{session id}/refreshRefreshReloads the current page
GET/session/{session id}/titleGet TitleReturns the document title of the current page
MethodURI TemplateCommandDescription
GET/session/{session id}/windowGet Window HandleReturns the handle of the current top-level browsing context
DELETE/session/{session id}/windowClose WindowCloses the current top-level browsing context
POST/session/{session id}/windowSwitch To WindowSwitches the current top-level browsing context by handle
GET/session/{session id}/window/handlesGet Window HandlesReturns all window handles for the session
POST/session/{session id}/window/newNew WindowCreates a new top-level browsing context (tab or window)
POST/session/{session id}/frameSwitch To FrameSwitches the current browsing context to a frame (by index, element, or null for top)
POST/session/{session id}/frame/parentSwitch To Parent FrameSets the current browsing context to the parent of the current context
MethodURI TemplateCommandDescription
GET/session/{session id}/window/rectGet Window RectReturns the size and position of the OS window
POST/session/{session id}/window/rectSet Window RectSets the size and position of the OS window
POST/session/{session id}/window/maximizeMaximize WindowMaximizes the OS window
POST/session/{session id}/window/minimizeMinimize WindowIconifies/minimizes the OS window
POST/session/{session id}/window/fullscreenFullscreen WindowMakes the OS window fullscreen
MethodURI TemplateCommandDescription
POST/session/{session id}/elementFind ElementFinds a single element in the current browsing context
POST/session/{session id}/elementsFind ElementsFinds all elements matching a selector
POST/session/{session id}/element/{element id}/elementFind Element From ElementFinds a single element starting from a given element
POST/session/{session id}/element/{element id}/elementsFind Elements From ElementFinds all matching elements starting from a given element
POST/session/{session id}/shadow/{shadow id}/elementFind Element From Shadow RootFinds a single element within a shadow root
POST/session/{session id}/shadow/{shadow id}/elementsFind Elements From Shadow RootFinds all matching elements within a shadow root
GET/session/{session id}/element/activeGet Active ElementReturns the currently focused element
GET/session/{session id}/element/{element id}/shadowGet Element Shadow RootReturns the shadow root of an element
MethodURI TemplateCommandDescription
GET/session/{session id}/element/{element id}/selectedIs Element SelectedReturns whether an input/option element is selected
GET/session/{session id}/element/{element id}/attribute/{name}Get Element AttributeReturns the value of an element’s attribute
GET/session/{session id}/element/{element id}/property/{name}Get Element PropertyReturns the value of an element’s JS property
GET/session/{session id}/element/{element id}/css/{property name}Get Element CSS ValueReturns the computed value of a CSS property
GET/session/{session id}/element/{element id}/textGet Element TextReturns the element’s rendered text
GET/session/{session id}/element/{element id}/nameGet Element Tag NameReturns the element’s tag name
GET/session/{session id}/element/{element id}/rectGet Element RectReturns the element’s bounding rectangle (x, y, width, height)
GET/session/{session id}/element/{element id}/enabledIs Element EnabledReturns whether a form control element is enabled
GET/session/{session id}/element/{element id}/computedroleGet Computed RoleReturns the WAI-ARIA role of the element
GET/session/{session id}/element/{element id}/computedlabelGet Computed LabelReturns the accessible name of the element
MethodURI TemplateCommandDescription
POST/session/{session id}/element/{element id}/clickElement ClickScrolls into view and clicks the element’s center point
POST/session/{session id}/element/{element id}/clearElement ClearClears a content-editable or resettable form element
POST/session/{session id}/element/{element id}/valueElement Send KeysSends keystrokes to an element (or sets files on an input[type=file])
MethodURI TemplateCommandDescription
GET/session/{session id}/sourceGet Page SourceReturns the serialized DOM of the active document
POST/session/{session id}/execute/syncExecute ScriptExecutes a JavaScript function body synchronously
POST/session/{session id}/execute/asyncExecute Async ScriptExecutes a JavaScript function body with an async completion callback
MethodURI TemplateCommandDescription
GET/session/{session id}/cookieGet All CookiesReturns all cookies visible to the current page
GET/session/{session id}/cookie/{name}Get Named CookieReturns a cookie by name
POST/session/{session id}/cookieAdd CookieCreates a cookie for the current page
DELETE/session/{session id}/cookie/{name}Delete CookieDeletes a cookie by name
DELETE/session/{session id}/cookieDelete All CookiesDeletes all cookies for the current page
MethodURI TemplateCommandDescription
POST/session/{session id}/actionsPerform ActionsDispatches tick-based input actions (key, pointer, wheel)
DELETE/session/{session id}/actionsRelease ActionsReleases all keys and pointer buttons, resets input state
MethodURI TemplateCommandDescription
POST/session/{session id}/alert/dismissDismiss AlertDismisses (cancels) the current user prompt
POST/session/{session id}/alert/acceptAccept AlertAccepts (OKs) the current user prompt
GET/session/{session id}/alert/textGet Alert TextReturns the message of the current user prompt
POST/session/{session id}/alert/textSend Alert TextSets the text field of a window.prompt dialog
MethodURI TemplateCommandDescription
GET/session/{session id}/screenshotTake ScreenshotCaptures the viewport as a Base64 PNG
GET/session/{session id}/element/{element id}/screenshotTake Element ScreenshotCaptures an element’s bounding rect as a Base64 PNG
MethodURI TemplateCommandDescription
POST/session/{session id}/printPrint PageRenders the page to PDF, returned as Base64