Article

macOS WebDriver Commands for Safari 12 and later

WebDriver is a browser-automation API that you use to create automated tests of your web content. The Safari implementation of WebDriver supports the W3C endpoints.

Overview

This table lists the method and the URI template (the endpoint) that executes each command. The macOS WebDriver Commands for Safari 11.1 and earlier supports the Selenium JSON Wire Protocol. The macOS WebDriver Commands for Safari 12 and later supports the the W3C WebDriver protocol.

All URI templates listed here work in Safari on iOS 12 and later.

Method

URI template

Supported

Safari Technology Preview release, Safari version

POST

/session

60, 12

DELETE

/session/{session id}

60, 12

GET

/status

60, 12

GET

/session/{session id}/timeouts

60, 12

POST

/session/{session id}/timeouts

60, 12

POST

/session/{session id}/url

60, 12

GET

/session/{session id}/url

60, 12

POST

/session/{session id}/back

60, 12

POST

/session/{session id}/forward

60, 12

POST

/session/{session id}/refresh

60, 12

GET

/session/{session id}/title

60, 12

GET

/session/{session id}/window

60, 12

DELETE

/session/{session id}/window

60, 12

POST

/session/{session id}/window

60, 12

GET

/session/{session id}/window/handles

60, 12

POST

/session/{session id}/frame

60, 12

POST

/session/{session id}/frame/parent

60, 12

GET

/session/{session id}/window/rect

60, 12

POST

/session/{session id}/window/rect

60, 12

POST

/session/{session id}/window/maximize

60, 12

POST

/session/{session id}/window/maximize

60, 12

POST

/session/{session id}/window/fullscreen

60, 12

GET

/session/{session id}/element/active

60, 12

POST

/session/{session id}/element

60, 12

POST

/session/{session id}/elements

60, 12

POST

/session/{session id}/element/{element id}/element

60, 12

POST

/session/{session id}/element/{element id}/elements

60, 12

GET

/session/{session id}/element/{element id}/selected

60, 12

GET

/session/{session id}/element/{element id}/attribute/{name}

60, 12

GET

/session/{session id}/element/{element id}/property/{name}

60, 12

GET

/session/{session id}/element/{element id}/css/{property name}

60, 12

GET

/session/{session id}/element/{element id}/text

60, 12

GET

/session/{session id}/element/{element id}/name

60, 12

GET

/session/{session id}/element/{element id}/rect

60, 12

GET

/session/{session id}/{element id}/enabled

60, 12

POST

/session/{session id}/element/{element id}/click

60, 12

POST

/session/{session id}/element/{element id}/clear

60, 12

POST

/session/{session id}/element/{element id}/value

60, 12

GET

/session/{session id}/source

60, 12

POST

/session/{session id}/execute/sync

60, 12

POST

/session/{session id}/execute/async

60, 12

GET

/session/{session id}/cookie

60, 12

GET

/session/{session id}/cookie/{name}

60, 12

POST

/session/{session id}/cookie

60, 12

DELETE

/session/{session id}/cookie/{name}

60, 12

DELETE

/session/{session id}/cookie

60, 12

POST

/session/{session id}/actions

60, 12

DELETE

/session/{session id}/actions

60, 12

POST

/session/{session id}/alert/dismiss

60, 12

POST

/session/{session id}/alert/accept

60, 12

GET

/session/{session id}/alert/text

60, 12

POST

/session/{session id}/alert/text

60, 12

GET

/session/{session id}/screenshot

60, 12

GET

/session/{session id}/element/{element id}/screenshot

60, 12

See Also

WebDriver

macOS WebDriver Commands for Safari 11.1 and earlier

WebDriver is a browser-automation API that you use to create automated tests of your web content. The Safari implementation of WebDriver supports the Selenium JSON Wire Protocol.

About WebDriver for Safari

Read about Safari’s enhanced implementation of a common API for test automation.

Testing with WebDriver in Safari

Enable WebDriver and run a test.