История страницы
...
Scroll to element Version 2 (Net)
Группа действий: Windows Подгруппа "Работа с win-элементами"
Описание
Действие определяет координаты указанного элемента в окне и производит скролл к этому элементу, пока он не будет приближен максимально к центру экрана
Иконка действия
Параметры
Входные параметры
Элемент Параметр, который хранит данные Win-элемента, координаты которого будут определяться
Тайм-аут Время в миллисекундах, в течение которого будет происходить поиск нужного элемента
Номер окна Порядковый номер окна, с которым будет взаимодействовать действие, если обнаружено несколько окон
При этом действие ищет только те окна, в которых должен находиться элемент согласно его параметрам
Положительное целое число от 1. По умолчанию - "1"
Action group: Windows Subgroup: Interaction with Win-elements
...
Description
The action determines the coordinates of the specified element in the window and scrolls to this element until it is as close as possible to the center of the screen.
Action icon
Parameters
Input parameters
Element - parameter that stores the data of the Win-element whose coordinates will be defined
Timeout - the time in milliseconds for which the desired element will be searched.
Window order - the sequence number of the window that the action should work with. If you do not specify a window number, the first window will be checked. The numbering starts from 1.
Settings
...
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Element | A resource that stores data about the selected application element. | Robin.WinElement | Yes | |
Time-out, ms | The time in milliseconds for which the desired element will be searched. | Robin.Numeric | No | |
Window order | The sequence number of the window that the action should work with. If you do not specify a window number, the first window will be checked. The numbering starts from 1. | Robin.Numeric | No |
Особые условия использования
- Указанный элемент может находиться за пределами видимой части окна.
- Если элемент уже находится приближенно к центру экрана, то действие ничего не меняет, робот ошибку не выдает.
Пример использования
Задача
Открыть окно "Excel", необходимо найти нужный шаблон:
Решение
Воспользоваться действием "Скролл к элементу".
Реализация
- Собрать робота, состоящего из действий:
- Настроить параметры действия "Run":
- Настроить параметры действия "Скролл к элементу". Элемент необходимо получить с помощью инструмента WinSpy. Работа с WinSpy описана в разделе Получение win-элемента. Установка тайм-аута, в целом, не приводит к увеличению времени выполнения действия сверх того времени, которое потребуется для того, чтобы элемент, который мы используем в действии стал видимым и доступным. В течение установленного тайм-аута действие пытается получить доступ к элементу с которым работает. Как только появляется доступ к элементу, ожидание тайм-аут заканчивается.
- Нажать на кнопку "Старт" в верхней панели.
Результат
Программный робот отработал успешно.
Исходное положение:
Special conditions of use
- The specified element may be outside the visible part of the window.
- If the item is already close to the center of the screen, the action does not change anything, the robot does not generate an error.
Example of use
Task
Open an Excel window, find the needed template:
Solution
Use the "Scroll to element" action.
Implementation
- Assemble a robot scheme with the actions:
- Set the "Run" action parameters.
- Set the parameters of the “Scroll to element” action. The element must be obtained using the WinSpy tool. Working with WinSpy is described in the Получение win-элемента section. Setting a timeout does not, in general, increase the execution time of an action beyond the time it takes for the item used 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.
- Click "Start" in the top panel.
Result
The program robot completed successfully.
Starting position:
The “Scroll to element” action found the desired Win-element and scrolled to itДействие "Скролл к элементу" нашло нужный Win-элемент и пролистал к нему.