通过 ssh 运行 safaridriver 总是询问密码 [英] Running safaridriver thorugh ssh always asks password

查看:32
本文介绍了通过 ssh 运行 safaridriver 总是询问密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 virtualbox 上的虚拟机中运行 safari selenium 测试.

I would like to run safari selenium test in virtual machine on virtualbox.

我在虚拟机中运行 macOS Sierra 10.12.教程说你需要运行

I have running macOS Sierra 10.12 inside virtual box. Tutorials say that you need to run

/usr/bin/safaridriver

/usr/bin/safaridriver

一次,授权它.我就是这么做的.当我通过虚拟框的 GUI 在终端中启动它们时,测试运行完美.但是当我通过 ssh 连接到那个虚拟机时,我总是被要求输入密码.当我无法提供密码时,独立运行 webdriver-manager/selenium 会出现问题.

once, to authorise it. I did that. And tests run perfectly, when I start them in terminal through GUI of virtual box. But when I ssh to that virtual box machine, I always got asked for password. It is a problem when running webdriver-manager / selenium standalone, when I cannot provide password.

Vbox:Safari 10.0、macOS Sierra 10.12

Vbox: Safari 10.0, macOS Sierra 10.12

推荐答案

这是 Safari 10 中的一个已知问题,除了通过窗口服务器使用终端之外,没有已知的解决方法.

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

在 Safari 11+ 上,safaridriver 只需要您运行 safaridriver --enable,并且身份验证将在登录会话的其余部分被缓存.因此,您应该将其添加到登录机器的脚本中.

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.

如果您使用 ssh 连接并且没有运行窗口服务器,则 safaridriver 将无法工作,这是一个单独的问题.目前没有解决方法——机器需要一个 GUI 会话来运行 Safari 和 webdriver.

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.

这篇关于通过 ssh 运行 safaridriver 总是询问密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆