Before executing tests in Safari, make sure you enable Remote Automation in the Safari browser.
To allow remote automation in Safari, you must turn on WebDriver support:
1.
To enable the Develop menu in the Safari browser, click Safari > Preferences > Advanced tab. Select the Show Develop Menu check box. The Develop menu appears in the menu bar.
2.
To enable Remote Automation click Develop > Allow Remote Automation in the menu bar.