Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Get element text Version 16 (.Net)

Группа действийAction group: Windows

Описание

Действие возвращает текст выбранного элемента.

...

Description

The action returns the text of the selected element.

Action icon

...

Settings of parameters

СвойствоОписаниеТипПример заполненияОбязательность заполнения поля
Параметры
ЭлементРесурс который хранит данные о выбранном элементе приложения.Robin.WinElement
Да
Тайм-аутВремя в миллисекундах, в течении которого будет происходить поиск нужного окна.Robin.Numeric
Нет
Номер окнаЕсли найдено несколько окон, то действие взаимодействует с окном под указанным номеромRobin.Numeric
Нет
Результаты
РезультатТекст из выбранного элемента.Robin.String

Особые условия использования

Не требуется предварительная активация окна, содержащего элемент.

Группа не работает с панелью задач, проводником и рабочим столом.

Пример использования 

Задача

Открыто окно "Параметры", необходимо получить текст элемента (название процессора):

Image Removed

Решение

Воспользоваться действием "Получить текст элемента", "Сообщение". 

Реализация

...



Special conditions of use

Preliminary activation of the window with the element is not needed.

The group does not work with taskbar, explorer, and workspace.

Example of use

Task

There is an open "Parameters" window. Get element text (processor name).

Image Added

Solution

Use the "Get element text", "Show message" actions.

Implementation

  1. Move the "Get element text", "Show message" actions to the workspace.
    Image Added
  2. Set the "Get element text" action parameters. Get the element with the WinSpy tool. Working with WinSpy is described in section Get Win-element
    Setting a timeout does not, in general, increase the execution time of an action beyond the time it takes for the item we are using in the action to become visible and accessible. During the set timeout, the action tries to access the element it is working with. As soon as the item is available, the waiting timeout expires.
    Image Added
  3. Set the "Show message" action parameters. In the "Message text" field specify the "Get element text" action result.

    Image Added
  4. Click "Start" in the top panel.

Result

The program robot completed successfully.

Image Added

The robot displayed the element text

Результат

Программный робот отработал успешно.

Image Removed

Робот вывел текст элемента.