UiPath Documentation
activities
latest
false
重要 :
请注意,此内容已使用机器翻译进行了部分本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。
UiPath logo, featuring letters U and I in white

用户界面自动化活动

上次更新日期 2026年4月16日

故障排除场景

如果遇到问题,请考虑以下故障排除方案:

移动设备自动化

以下主题描述了移动设备自动化的问题及其相应的解决方法。

生成错误的工作流和活动

Description: The workflow in Studio throws unexpected errors, and the activity packages don't display the versions installed.

Cause: Inside your project, the major version of the UI.Automation activity package doesn't match the major version of the Mobile.Automation activity package. For example, the major version of the UI.Automation package installed is 22.10.x, and the major version of the Mobile.Automation package installed is 22.4.x.

Remedy: Make sure that the major versions of the UI.Automation and Mobile.Automation activity packages, installed in your project, match. For example, pair UI.Automation.Activities version 22.10.x only with Mobile.Automation.Activities version 22.10.x.

重要提示:

Always use the latest available patches for the UI.Automation and Mobile.Automation activity packages. For example, if you have UI.Automation or Mobile.Automation 22.10 installed, then download the latest available patches for 22.10.

未找到 wd/hub/ 会话的路由

Condition: When using Appium 2.0.

Description: No route found for /wd/hub/session.

Remedy: Manually add the following parameter before starting the Appium session: --base-path /wd/hub.

所有非标准功能都需要供应商前缀

Condition: When using Appium 2.0.

Description: All non-standard capabilities should have a vendor prefix.

Remedy: Manually add the appium: prefix for all capabilities, as follows:

  • 在命令提示符或终端中,输入--default-capabilities "{\"appium:systemPort\": 8201}"而不是--default-capabilities "{\"systemPort\": 8201}" }。
  • In the Add a device tab from Mobile Device Manager, manually add the appium: prefix before the name of any additional desired capability.

自动化名称不能为空

Condition: When using Appium 2.0.

Description: The automationName capability can't be blank.

Remedy: Add appium: as a prefix. For example, appium:automationName.

找不到已安装的驱动程序

Condition: When using Appium 2.0.

Description: Could not find the installed driver to support given caps.

Appium 2.0 doesn't automatically install the required drivers. You have to download them separately.

Remedy: Install the required driver for your platform.

  • 对于 Android 设备,请使用appium driver install uiautomator2命令安装uiautomator2驱动程序。
  • 对于 iOS 设备,请使用 appium driver install xcuitest 命令来安装 xcuitest 驱动程序。

Android

以下主题描述了 Android 设备的问题及其相应的解决方法。

由于功能 InvalidArgumentException连接失败

说明:本地设备和应用程序之间的连接可能会由于功能的预期格式与InvalidArgumentException存在差异而失败。当功能以字符串形式输入,而 Appium 需要一个布尔值时,就会出现此问题。指示性错误消息包括:

Failed to create session. 
A new session could not be created. 
Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: 
Invalid '<capability name>' setting value type. 
Got java.lang.String. Expected: java.lang.Boolean
Failed to create session. 
A new session could not be created. 
Details: io.appium.uiautomator2.common.exceptions.InvalidArgumentException: 
Invalid '<capability name>' setting value type. 
Got java.lang.String. Expected: java.lang.Boolean

补救措施:从本地设备卸载以下应用程序:

  • io.appium.uiautomator2.server
  • io.appium.uiautomator2.server.test

活动由于以下原因失败 WebDriverException

说明:运行自动化 Android 设备的移动自动化工作流可能会导致WebDriverException 。此错误通常显示为Parameters were incorrect. We wanted {\"required\":[\"text\"]} and you sent [\"value\"]", "FaultCode":"WebDriverException"}

补救措施:卸载当前版本的 UiAutomator 2。然后按照给定顺序使用以下命令安装更新版本:

  1. appium driver uninstall uiautomator2
  2. appium driver install uiautomator2@2.29.0,其中 2.29.0 是您要安装的版本。您可以将其替换为任何可用版本。

由于代理原因,Appium 安装失败

说明:运行npm install -g appium (适用于Appium 1.x )或npm install -g appium@next (适用于Appium 2.0 )命令失败,因为您正在代理后面运行。错误将引发以下消息:

npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. 
See: 'npm help config'
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. 
See: 'npm help config'

补救措施:配置 npm(节点包管理器)以使用您的代理。请按照以下步骤操作:

  1. 获取您的代理服务器地址和端口号:
    • 转到“Internet 选项”

    • 选择“连接”选项卡。

    • 选择“局域网设置” ,然后复制“地址”“端口”字段中的内容。

      docs image

  2. 返回到Node.js命令提示符,然后运行采用以下格式的命令:
    • 对于 HTTP 代理: npm config set http://your_proxy_address:your_port_number
    • 对于 HTTPS 代理:npm config set https://your_proxy_address:your_port_number
  3. 再次运行npm install -g appium (适用于Appium 1.x )或npm install -g appium@next (适用于Appium 2.0 )命令。

无法访问所提供的网页上下文

说明:无法访问提供的 Web 上下文。请确保 Android WebView 可调试。有关访问网页上下文的更多信息,请访问远程调试 WebView

Remedies:

设备未授权

Description: Device not authorized.

Remedy: Take the following steps:

  1. 使用 adb devices 命令检查现有的设备。
  2. Revoke Debugging on phone.
  3. Restart the ADB server, by using the following commands, in this order: adb kill-server, and then adb start-server.
  4. 重新连接设备,并确认您同意该设备上的连接。

从启动屏幕启动时的浏览器自动化

说明:Android 设备启动浏览器自动化而非给定应用程序,从而导致错误。

Remedy: Start with a web browser instead.

Android 应用程序无法启动

Description: the Android app that you created doesn't launch in Mobile Device Manager.

Remedy:

  • Hover over the application and click Edit.
  • Add information about the app inside the App package and App activity fields.

iOS

以下主题描述了 iOS 设备的问题及其相应的解决方法。

无法在 iOS 13 上单击 WebView 元素

说明:单击 WebView 元素时,选取器不起作用,您无法自动化该元素。

补救措施:使用装有最新版本 iOS 和 Appium 2 的模拟器。

iOS 物理设备无法启动

Description: iOS physical device fails to start.

Remedy: Take the following steps:

  • 确保您的设备信任该证书。在您的设备上,前往“设置” > “通用” > “配置文件与设备管理” ,点击电子邮件条目(例如Apple 开发: username@email.com )、然后信任该证书。如果设备使用的是您的公司帐户,则不需要此操作。
  • 如果收到无法访问端口 8100 的错误,请关闭 Appium (ctrl + c),然后重新启动。
  • 如果您收到其他错误,请考虑查看 Appium XCUITest 驱动程序真实设备

iOS 16.0 设备无法启动

Description: iOS 16.0 device fails to start or connect.

补救措施 :安装并使用 Appium 2.0 ,而不是 Appium 1 。有关安装和管理 Appium 2.0 的更多信息,请查看 本地 iOS 设备先决条件 部分。

iOS 12.4.5 故障

Description: iOS 12.4.5 doesn't work as expected while paired with Appium 1.22.3.

Cause: This is caused by an issue with Appium.

Remedy: Choose one of the options below:

  • 使用较低版本的 Appium,例如 1.17.0。
重要提示:

这可能会导致最新版本的 XCode 出现问题,并且可能无法在 macOS 蒙特利 上按预期工作。

  • 将设备升级到等于或高于 iOS 14 的版本。

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新