Running safaridriver thorugh ssh always asks password

岁酱吖の 提交于 2019-12-01 01:47:29
user8672807

I have similar issue as stated above, I tried to run safaridriver --enable on Mac OS Sierra Safari 11 and I still got prompt to enter password.

Also when I run tests on selenium node and selenium hub which are started from terminal inside virtual box safari launches, however when I ssh to that virtual box machine to start the same process I get the following error

13:45:50 Exception is org.openqa.selenium.SessionNotCreatedException: Cannot establish new session 13:45:50 Build info: version: '3.5.3', revision: 'a88d25fe6b', time: '2017-08-29T12:54:15.039Z'

workaround I found to overcome this issue is to create Applescript which will execute the script you desire and then execute this Applescript over ssh.

Apple Script
============

    Tell Application "Terminal"
        activate
        set Shell to do Script "your script"
    end Tell

now you can invoke this script over ssh osascript "${pathToScript}/run.scpt"

This is a known issue in Safari 10 with no known workaround, except to use a terminal via the window server.

On Safari 11+, safaridriver only requires you to run safaridriver --enable, and the authentication will be cached for the rest of the login session. So, you should just add this to your script that logs into the machine.

There is a separate issue that safaridriver does not work if you have ssh'd in and there is no window server running. There is no workaround for this at the moment–the machine needs a GUI session to run Safari and webdriver.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!