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

用户界面自动化活动

上次更新日期 2024年12月4日

The UiElement is no longer valid

描述

A UI Automation activity (for example, Click, Type Into, etc.) fails with the following error message: The UiElement is no longer valid.

原因

The possible causes of the issue are the following:

  • The issue could occur in web automation processes when the web page is reloaded after the selector search found the UI element, but the action on that element is yet to be executed.

    This may happen when looking for a web element that is no longer in the tab or in the frame, either because it was refreshed and invalidated, or because something on the page changed, and the selector no longer matches.

    The page might refresh automatically, even without any explicit instruction to refresh the screen.

  • The issue could occur when the UI element is stored in a variable using the Check App State activity, for example, and the element is later used in another activity, following a refresh.
  • The issue could occur if a located element is stored in the cache, but if the page changes in the meantime, this could make the reference invalid.

解决方案

To avoid this issue, you can do the following:

  • Include the specific UI Automation activity in a Retry Scope activity.
  • Check the readiness of the UI Element prior to the action, using the Check App State activity (or classic activities Find Element or Element Exists).
  • Indicate the UI element again after the refresh, if an automatic page refresh occurs.
  • Increase the Delay after/Delay before properties values or set the Timeout seconds value.
  • 描述
  • 原因
  • 解决方案

此页面有帮助吗?

获取您需要的帮助
了解 RPA - 自动化课程
UiPath Community 论坛
Uipath Logo White
信任与安全
© 2005-2024 UiPath。保留所有权利。