我正在尝试在MAC服务器上使用safari
启动selenium-webdriver
,但是出现以下错误
Error: Server terminated early with status 1
at earlyTermination.catch.e (/Users/administrator/repos/myproj/node_modules/selenium-webdriver/remote/index.js:251:52)
at <anonymous>
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
服务器上safari驱动程序的输出:
administrator$ /usr/bin/safaridriver
Could not start server: must specify at least one configuration argument.
Usage: safaridriver [options]
-h, --help Prints out this usage information.
-p, --port Port number the driver should use. If the server
is already running, the port cannot be changed.
If port 0 is specified, a default port will be used.
--enable Applies configuration changes so that subsequent WebDriver
sessions will run without further authentication.
注意:在服务器上,如果我指定端口不执行任何操作,则在我的本地计算机上它将侦听请求
用于启动野生动物园的代码
const { Builder, By, Key, until } = require('selenium-webdriver');
// ...
const driver = await new Builder().forBrowser('safari').build();
在我的本地计算机上,我没有任何错误。
我的机器和服务器都使用相同的Safari版本。
我必须在计算机上安装但我不在服务器上的任何东西吗?
为什么它不能在远程服务器上工作?
答案 0 :(得分:0)
所以,我运行了该命令
# To disable Screen Sharing
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
# To enable Screen Sharing
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.screensharing.plist
并通过Safari vnc://<ip>
在接口模式下,我执行命令时没有任何错误。因此,似乎无法从SSH正常运行