繁体   English   中英

selenium-webdriver与Safari-错误:服务器提前终止,状态为1

[英]selenium-webdriver with Safari - Error: Server terminated early with status 1

我正在尝试在MAC服务器上使用selenium-webdriver启动safari ,但出现以下错误

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版本。

我必须在机器上安装但在服务器上没有安装的服务器上有什么东西吗?

为什么在远程服务器上不起作用?

所以,我运行了这个命令

# 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正常运行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM