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

用户界面自动化活动

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

键入

在指定的用户界面元素中输入文本,例如文本框。 您还可以向用户界面元素发送特殊键(如 Tab 或 Enter)。

如果要安全地输入敏感信息,请在此 API 之前添加“获取凭据” API,然后选择该 API 中保存以备后用的用户名和密码值作为要键入的文本。

必须在“打开”“附加”之后添加此 API。

定义

命名空间:UiPath.UIAutomationNext.API.Models

程序集:UiPath.UIAutomationNext.API.Models(位于 UiPath.UIAutomationNext.API.Models dll 中)

重载

重载描述
TypeInto(TargetAnchorableModel, String)在指定的用户界面元素中输入文本,该文本标识为对象存储库中的字符串。
TypeInto(TargetAnchorableModel, TypeIntoOptions)在指定的用户界面元素中输入文本,该元素标识为 TargetAnchorableModel 对象。
TypeInto(String, String)在指定的用户界面元素中输入文本,该文本标识为对象存储库中的字符串。
TypeInto(String, TypeIntoOptions)在指定的用户界面元素中输入文本(标识为对象存储库中的字符串)以及其他配置。

TypeInto(TargetAnchorableModel, String)

在指定的用户界面元素中输入文本,该文本标识为对象存储库中的字符串。

TypeInto(
    TargetAnchorableModel target,
    string text)
TypeInto(
    TargetAnchorableModel target,
    string text)

target TargetAnchorableModel :目标用户界面元素,标识为TargetAnchorableModel对象。

text “字符串” :要在其中键入内容的文本。

TypeInto(TargetAnchorableModel, TypeIntoOptions)

在指定的用户界面元素中输入文本,该元素标识为 TargetAnchorableModel 对象。

TypeInto(
    TargetAnchorableModel target,
    TypeIntoOptions typeIntoOptions)
TypeInto(
    TargetAnchorableModel target,
    TypeIntoOptions typeIntoOptions)

target TargetAnchorableModel :目标用户界面元素,标识为TargetAnchorableModel对象。

typeIntoOptions TypeIntoOptions :可选择以下选项:

* `Text
  String` - The text that you want to type into.
* `DelayBetweenKeys Double` - Delay (in
  seconds) between consecutive keystrokes. The default value is 0.02
  seconds.
* `ActivateBefore Boolean` - If true,
  the specified UI element is brought to the foreground and activated
  before the text is typed in. If false, the API will type into the
  current active window.
* `ClickBeforeMode NClickMode` - the
  type of click to perform before typing into:
  + `None`
  + `Single`
  + `Double`
* `EmptyFieldMode NEmptyFieldMode` -
  Choose whether to delete the existing content in the field
  before typing the text, and how to empty the field. Fields are
  emptied by sending a combination of keystrokes that differs
  between fields with a single line and fields with multiple
  lines. Make sure to select the right option depending on the
  indicated field. The options are:
  + `None`
  + `SingleLine`
  + `MultiLine`
* `DeselectAfter Boolean` - This can
  only be used when the `InteractionMode` is set to
   `Simulate`. Some target applications do not
  register a type action unless a Complete event is also sent
  alongside the action. Setting this to true adds a Complete event
  after the text entry, in order to register the action correctly. If
  you set it to false, the Complete event is not sent to the target
  application. By default, this is set to true.
* `AlterIfDisabled Boolean` - If set to
  true, the Select Item action is executed even if the specified UI
  element is disabled. This parameter does not apply if the
  `InteractionMode` is set to `Hardware
  Events`. By default, this is false.
* `InteractionMode
  NChildInteractionMode` - Specifies the API used to
  perform the action. The following options are available:
  + `SameAsCard` - Use the same input mode
    as [Open](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-open) or [Attach](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-attach). This is the default selection.
  + `HardwareEvents` - Uses the hardware
    driver to perform the action. This is the slowest API, it
    cannot work in the background, but it is compatible with all
    desktop apps.
  + `Simulate` - Simulates the action using
    accessibility APIs. Recommended in browser automation, Java
    apps, or SAP. More reliable than Hardware Events. Sends all
    text in a single action. Works even if the target
    application is not in focus. Please test if your target
    application UI element supports this.
  + `DebuggerApi` - Performs actions using
    debugger APIs. Works for Chromium elements only. Sends all
    text in one go. Works even if the target application is not
    in focus. For more details, check out this [page](https://docs.uipath.com/studio/docs/chromium-api).
  + `WindowMessages` - Sends the mouse and
    keyboard input through Win32 messages. Recommended for
    desktop apps. Usually more reliable than Hardware Events.
    Sends all text in a single action. Works even if target app
    is not in focus. Please test if your target application UI
    element supports this.
* `Text
  String` - The text that you want to type into.
* `DelayBetweenKeys Double` - Delay (in
  seconds) between consecutive keystrokes. The default value is 0.02
  seconds.
* `ActivateBefore Boolean` - If true,
  the specified UI element is brought to the foreground and activated
  before the text is typed in. If false, the API will type into the
  current active window.
* `ClickBeforeMode NClickMode` - the
  type of click to perform before typing into:
  + `None`
  + `Single`
  + `Double`
* `EmptyFieldMode NEmptyFieldMode` -
  Choose whether to delete the existing content in the field
  before typing the text, and how to empty the field. Fields are
  emptied by sending a combination of keystrokes that differs
  between fields with a single line and fields with multiple
  lines. Make sure to select the right option depending on the
  indicated field. The options are:
  + `None`
  + `SingleLine`
  + `MultiLine`
* `DeselectAfter Boolean` - This can
  only be used when the `InteractionMode` is set to
   `Simulate`. Some target applications do not
  register a type action unless a Complete event is also sent
  alongside the action. Setting this to true adds a Complete event
  after the text entry, in order to register the action correctly. If
  you set it to false, the Complete event is not sent to the target
  application. By default, this is set to true.
* `AlterIfDisabled Boolean` - If set to
  true, the Select Item action is executed even if the specified UI
  element is disabled. This parameter does not apply if the
  `InteractionMode` is set to `Hardware
  Events`. By default, this is false.
* `InteractionMode
  NChildInteractionMode` - Specifies the API used to
  perform the action. The following options are available:
  + `SameAsCard` - Use the same input mode
    as [Open](https://docs.uipath.com/zh-CN/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-open) or [Attach](https://docs.uipath.com/zh-CN/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-attach). This is the default selection.
  + `HardwareEvents` - Uses the hardware
    driver to perform the action. This is the slowest API, it
    cannot work in the background, but it is compatible with all
    desktop apps.
  + `Simulate` - Simulates the action using
    accessibility APIs. Recommended in browser automation, Java
    apps, or SAP. More reliable than Hardware Events. Sends all
    text in a single action. Works even if the target
    application is not in focus. Please test if your target
    application UI element supports this.
  + `DebuggerApi` - Performs actions using
    debugger APIs. Works for Chromium elements only. Sends all
    text in one go. Works even if the target application is not
    in focus. For more details, check out this [page](https://docs.uipath.com/zh-CN/studio/docs/chromium-api).
  + `WindowMessages` - Sends the mouse and
    keyboard input through Win32 messages. Recommended for
    desktop apps. Usually more reliable than Hardware Events.
    Sends all text in a single action. Works even if target app
    is not in focus. Please test if your target application UI
    element supports this.

TypeInto(String, String)

在指定的用户界面元素中输入文本,该文本标识为对象存储库中的字符串。

TypeInto(
    string target,
    string text)
TypeInto(
    string target,
    string text)

target :要在其中输入内容的目标用户界面元素,从对象存储库中标识为字符串。

text “字符串” :要在其中键入内容的文本。

TypeInto(String, TypeIntoOptions)

在指定的用户界面元素中输入文本(标识为对象存储库中的字符串)以及其他配置。

TypeInto(
    string target,
    TypeIntoOptions typeIntoOptions)
TypeInto(
    string target,
    TypeIntoOptions typeIntoOptions)

target :要在其中输入内容的目标用户界面元素,从对象存储库中标识为字符串。

typeIntoOptions TypeIntoOptions :可选择以下选项:

* `Text
  String` - The text that you want to type into.
* `DelayBetweenKeys Double` - Delay (in
  seconds) between consecutive keystrokes. The default value is 0.02
  seconds.
* `ActivateBefore Boolean` - If true,
  the specified UI element is brought to the foreground and activated
  before the text is typed in. If false, the API will type into the
  current active window.
* `ClickBeforeMode NClickMode` - the
  type of click to perform before typing into:
  + `None`
  + `Single`
  + `Double`
* `EmptyFieldMode NEmptyFieldMode` -
  Choose whether to delete the existing content in the field
  before typing the text, and how to empty the field. Fields are
  emptied by sending a combination of keystrokes that differs
  between fields with a single line and fields with multiple
  lines. Make sure to select the right option depending on the
  indicated field. The options are:
  + `None`
  + `SingleLine`
  + `MultiLine`
* `DeselectAfter Boolean` - This can
  only be used when the `InteractionMode` is set to
   `Simulate`. Some target applications do not
  register a type action unless a Complete event is also sent
  alongside the action. Setting this to true adds a Complete event
  after the text entry, in order to register the action correctly. If
  you set it to false, the Complete event is not sent to the target
  application. By default, this is set to true.
* `AlterIfDisabled Boolean` - If set to
  true, the Select Item action is executed even if the specified UI
  element is disabled. This parameter does not apply if the
  `InteractionMode` is set to `Hardware
  Events`. By default, this is false.
* `InteractionMode
  NChildInteractionMode` - Specifies the API used to
  perform the action. The following options are available:
  + `SameAsCard` - Use the same input mode
    as [Open](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-open) or [Attach](https://docs.uipath.com/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-attach). This is the default selection.
  + `HardwareEvents` - Uses the hardware
    driver to perform the action. This is the slowest API, it
    cannot work in the background, but it is compatible with all
    desktop apps.
  + `Simulate` - Simulates the action using
    accessibility APIs. Recommended in browser automation, Java
    apps, or SAP. More reliable than Hardware Events. Sends all
    text in a single action. Works even if the target
    application is not in focus. Please test if your target
    application UI element supports this.
  + `DebuggerApi` - Performs actions using
    debugger APIs. Works for Chromium elements only. Sends all
    text in one go. Works even if the target application is not
    in focus. For more details, check out this [page](https://docs.uipath.com/studio/docs/chromium-api).
  + `WindowMessages` - Sends the mouse and
    keyboard input through Win32 messages. Recommended for
    desktop apps. Usually more reliable than Hardware Events.
    Sends all text in a single action. Works even if target app
    is not in focus. Please test if your target application UI
    element supports this.
* `Text
  String` - The text that you want to type into.
* `DelayBetweenKeys Double` - Delay (in
  seconds) between consecutive keystrokes. The default value is 0.02
  seconds.
* `ActivateBefore Boolean` - If true,
  the specified UI element is brought to the foreground and activated
  before the text is typed in. If false, the API will type into the
  current active window.
* `ClickBeforeMode NClickMode` - the
  type of click to perform before typing into:
  + `None`
  + `Single`
  + `Double`
* `EmptyFieldMode NEmptyFieldMode` -
  Choose whether to delete the existing content in the field
  before typing the text, and how to empty the field. Fields are
  emptied by sending a combination of keystrokes that differs
  between fields with a single line and fields with multiple
  lines. Make sure to select the right option depending on the
  indicated field. The options are:
  + `None`
  + `SingleLine`
  + `MultiLine`
* `DeselectAfter Boolean` - This can
  only be used when the `InteractionMode` is set to
   `Simulate`. Some target applications do not
  register a type action unless a Complete event is also sent
  alongside the action. Setting this to true adds a Complete event
  after the text entry, in order to register the action correctly. If
  you set it to false, the Complete event is not sent to the target
  application. By default, this is set to true.
* `AlterIfDisabled Boolean` - If set to
  true, the Select Item action is executed even if the specified UI
  element is disabled. This parameter does not apply if the
  `InteractionMode` is set to `Hardware
  Events`. By default, this is false.
* `InteractionMode
  NChildInteractionMode` - Specifies the API used to
  perform the action. The following options are available:
  + `SameAsCard` - Use the same input mode
    as [Open](https://docs.uipath.com/zh-CN/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-open) or [Attach](https://docs.uipath.com/zh-CN/activities/other/latest/ui-automation/uipath-uiautomationnext-api-contracts-iuiautomationappservice-attach). This is the default selection.
  + `HardwareEvents` - Uses the hardware
    driver to perform the action. This is the slowest API, it
    cannot work in the background, but it is compatible with all
    desktop apps.
  + `Simulate` - Simulates the action using
    accessibility APIs. Recommended in browser automation, Java
    apps, or SAP. More reliable than Hardware Events. Sends all
    text in a single action. Works even if the target
    application is not in focus. Please test if your target
    application UI element supports this.
  + `DebuggerApi` - Performs actions using
    debugger APIs. Works for Chromium elements only. Sends all
    text in one go. Works even if the target application is not
    in focus. For more details, check out this [page](https://docs.uipath.com/zh-CN/studio/docs/chromium-api).
  + `WindowMessages` - Sends the mouse and
    keyboard input through Win32 messages. Recommended for
    desktop apps. Usually more reliable than Hardware Events.
    Sends all text in a single action. Works even if target app
    is not in focus. Please test if your target application UI
    element supports this.

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新