启动 Appium 时无法连接 http://127.0.0.1:4723/。
我想使用 Appium Tizen TV 驱动程序来自动测试 appium-tizen-tv。为此,我正在使用 https://www.npmjs.com/package/appium-tizen-tv-driver
现在当我启动 Appium 时
我明白了
[Appium] Welcome to Appium v2.9.0
[Appium] The autodetected Appium home path: /Users/David/.appium
[Appium] Attempting to load driver tizentv...
[Appium] Requiring driver at /Users/David/.appium/node_modules/appium-tizen-tv-driver/build/lib/index.js
[Appium] TizenTVDriver has been successfully loaded in 2.200s
[Appium] Appium REST http interface listener started on http://0.0.0.0:4723
[Appium] You can provide the following URLs in your client code to connect to this server:
[Appium] http://127.0.0.1:4723/ (only accessible from the same host)
[Appium] http://172.16.16.27:4723/
[Appium] Available drivers:
[Appium] - [email protected] (automationName 'TizenTV')
[Appium] No plugins have been installed. Use the "appium plugin" command to install the one(s) you want to use.
所以当我使用这个时
http://127.0.0.1:4723/status
我得到了正确的回应,例如:
{
"value": {
"ready": true,
"message": "The server is ready to accept new connections",
"build": {
"version": "2.9.0"
}
}
}
现在当我使用这个时:
http://127.0.0.1:4723/wd/hub,因为我的代码需要这样连接驱动程序
driver = new AppiumDriver (new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
我收到此错误:
{
"status": 9,
"value": {
"error": "unknown command",
"message": "The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource",
"stacktrace": ""
}
}
运行代码时也是如此。知道如何解决这个问题。
注意:有一个7年前的旧答案。 老问题
你不需要appium 2.0中的
/wd/hub
,所以只需更改为这个就可以了
driver = new AppiumDriver (new URL("http://127.0.0.1:4723"),capabilities);