Safari | Cubano
Unlike the other browsers, Safari 10 and above come with built-in WebDriver support. To use the Safari driver you need to configure Safari to allow automation. As a feature intended for developers, Safari’s WebDriver support is turned off by default. To turn on WebDriver support, do the following:
-
Ensure that the Develop menu is available. It can be turned on by opening Safari preferences (
Safari
>Preferences
in the menu bar), going to theAdvanced
tab, and ensuring that theShow Develop
ß menu in menu bar checkbox is checked. -
Enable Remote Automation in the Develop menu. This is toggled via
Develop
>Allow Remote Automation
in the menu bar. -
The documentation states that you will also need to
“authorize safaridriver to launch the WebDriver service which hosts the local web server. To permit this, run
/usr/bin/safaridriver --enable
once and complete the authentication prompt if it is shown.”However it appears to run just fine without this step.
When using Selenium WebDriver, Safari opens a window that does not get closed when the tests complete.
Configuration
Apart from the standard settings (proxy, size, etc) there appears to be very little that can be configured in Safari as per Getting Started.
Safari can have problems with the webdriver.browser.postion
setting, so use this with care.
safari.option.useTechnologyPreview
Defaults to false
safari.option.useCleanSession
Defaults to false