appium安装运行报错的解决方案

2023-12-28 04:30:13

appium版本2.3

java17

运行报错:

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Could not find a driver for automationName 'UiAutomator2' and platformName 'android'. Have you installed a driver that supports those capabilities? Run 'appium driver list --installed' to see. (Lower-level error: Could not find installed driver to support given caps)?

原因:由于没有安装appium driver

使用下面的步骤:
?

appium driver install uiautomator2

但是出现了下面的报错:

Error: ? Encountered an error when installing package: npm command 'install --save-dev --no-progress --no-audit --prefer-offline --omit=peer --save-exact --global-style --no-package-lock appium-uiautomator2-driver --json' failed with code 1.
npm ERR! [22:01:34] Error installing Chromedriver: read ECONNRESET
npm ERR! [22:01:34] Error: read ECONNRESET
npm ERR! [22:01:34] Downloading Chromedriver can be skipped by setting the'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.
?

这个日志显示是由于需要设置APPIUM_SKIP_CHROMEDRIVER_INSTALL,但是没说怎么设置。

Downloading Chromedriver can be skipped by setting the'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.

墙了一下给出了答案:

 APPIUM_SKIP_CHROMEDRIVER_INSTALL=1 appium driver install uiautomator2

安装成功;

文章来源:https://blog.csdn.net/moso_wang/article/details/135233570
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。