Enable WebDriver on macOS
Enable WebDriver to automate testing of Safari on macOS.
Enabling WebDriver via Safari
From the Develop menu choose Developer Settings…
Check the Allow remote automation checkbox.
Enabling WebDriver via Terminal
Run safaridriver --enable. (If you are upgrading from a previous version of macOS you may need to use sudo.)