Safari WebDriver only works for admin users

I tested the Selenium-compatible Safari WebDriver implementation in Safari 11.1.2 (OS X 10.11.6) using a non-admin account and it fails in assert_process_still_running


======================================================================

ERROR: test_feature_status_page_filters (__main__.WebKitFeatureStatusTest)

----------------------------------------------------------------------

Traceback (most recent call last):

File "test_safariWebDriver.py", line 19, in setUp

self.driver = webdriver.Safari()

File "/Library/Python/2.7/site-packages/selenium/webdriver/safari/webdriver.py", line 50, in __init__

self.service.start()

File "/Library/Python/2.7/site-packages/selenium/webdriver/common/service.py", line 98, in start

self.assert_process_still_running()

File "/Library/Python/2.7/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running

% (self.path, return_code)

WebDriverException: Message: Service /usr/bin/safaridriver unexpectedly exited. Status code was: 1


I followed the instructions on the Webkit.org tech notes page (https://webkit.org/blog/6900/webdriver-support-in-safari-10/).


When I tried the exact same test with the same account with admin privileges it worked fine. Is this a bug, or the intended behavior?

Has anyone had success using the Safari WebDriver with non-admin users? Is there a way to enable its use for all users?

Replies

Hello Guys,


I am facing this issue too. I don't have admin rights on my Mac and got the below error when tried to launch the Safari Browser.


Traceback (most recent call last):

File "BraveTest.py", line 45, in <module>

driver = webdriver.Safari(executable_path = safari_driverpath)

File "/Users/p785756/Library/Python/3.6/lib/python/site-packages/selenium/webdriver/safari/webdriver.py", line 57, in __init__

self.service.start()

File "/Users/p785756/Library/Python/3.6/lib/python/site-packages/selenium/webdriver/common/service.py", line 98, in start

self.assert_process_still_running()

File "/Users/p785756/Library/Python/3.6/lib/python/site-packages/selenium/webdriver/common/service.py", line 111, in assert_process_still_running

% (self.path, return_code)

selenium.common.exceptions.WebDriverException: Message: Service /usr/bin/safaridriver unexpectedly exited. Status code was: 1


As per the below instruction mentioned in the page @ https://webkit.org/blog/6900/webdriver-support-in-safari-10/


“Authorize safaridriver to launch the webdriverd service which hosts the local web server. To permit this, run /usr/bin/safaridriver once manually and complete the authentication prompt.”


I ran the command “/usr/bin/safaridriver –enable” in the mac terminal and it asked for the password. I have entered my user password but got the message saying password is not valid. Does it require Admin Password.


Pls help me resolve this issue.


Thanks in Advance.