[英]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.