История страницы
...
Connect to an open browser Version 7 (Java)
Группа действийAction group: Браузеры Browsers
Описание
Действие подключается к заранее открытому окну браузера. Не происходит подключения к окнам, которые открыли или к которым подключились другие роботы.
Иконка действия
Параметры
Входные параметры
...
Description
The action connects to a pre-opened browser window. It does not connect to windows that other robots have opened or connected to.
Action icon
Parameters
Input parameters
- Browser - The name of the browser to connect to. For example: Chrome.
- Address - The default IP to connect to. The default value is localhost.
- Port - The port where the connection is coming from. The default value is 9222/.
Output parameters
The output is the browser instance that the actions will work with.
Settings
Property | Description | Type | Filling example | Mandatory field |
---|---|---|---|---|
Parameters | ||||
Browser | The name of the browser to connect to. | Robin.String | Yes | |
Address | IP address for connection. Default is localhost. | Robin.String | No | |
Port | IP address for connection. Default is 9222. | Robin.Numeric | No | |
Results | ||||
Context | The browser instance that actions will work with. | Robin.Selenium | Browser context |
Special conditions of use
Parameters may vary depending on the version.
The RobinRecorder 0.2 browser extension must be installed beforehand.
The following steps must be performed for the action to work correctly:
- Right-click on the browser shortcut and add
...
Выходные параметры
На выходе получаем экземпляр браузера, с которым будут работать действия.
Настройки
...
Browser
Название браузера, к которому нужно подключиться.
Выпадающий список из элементов: Chrome, Yandex
...
IP по умолчанию к которому надо подключиться. Значение по умолчанию localhost
...
Context
...
Особые условия использования
Параметры могут меняться в зависимости от версии.
Предварительно должно быть установлено расширение в браузере RobinRecorder 0.2
Для корректной отработки действия необходимо выполнить следующие действия:
- Нажать правой кнопкой мыши по ярлыку браузера и добавить в поле "Объект" параметр --remote-debugging-port=9222
Нажать на кнопку "ОК".
to the Object field
Click on the "OK" button. - Go to Task manager and check that no Chromium-based browsers are running (except the required one).
If they are running, close them.
List of these browsersЗайти в диспетчер задач и проверить, что не запущены браузеры, работающие на базе Chromium (кроме требуемого).
Если запущены, то закрыть их.
Список данных браузеров: https://ru.wikipedia.org/wiki/%D0%91%D1%80%D0%B0%D1%83%D0%B7%D0%B5%D1%80%D1%8B_%D0%BD%D0%B0_%D0%B1%D0%B0%D0%B7%D0%B5_Chromium - Установить веб-драйвера для браузеров Chrome и Yandex. Расположить, например, в корень диска С.
Скачать их можно по ссылкамInstall web drivers for Chrome and Yandex browsers. Place them, for example, in the root of the C drive.
You can download them by following the links: https://github.com/yandex/YandexDriver/releases и https://chromedriver.chromium.org/ - Проверить, что в папке .robin имеется файл env.cfg с указанными драйверами и их версиямиVerify that there is an env.cfg file in the .robin folder with the specified drivers and their versions.
- Перед запуском действия браузер должен быть свернутым.
- Если в браузере открыто несколько вкладок, действие может подключиться к любой из них. Если будет открыто несколько браузеров, действие подключается к тому экземпляру, который запущен первым.
Дополнительно:
- Если открыто несколько вкладок, то робот может подключиться к любой вкладке.
- Уведомления о работе под управлением робота в окне браузера не будет.
- После окончания работы робота страница браузера так и останется открытой, если не будет произведено еще каких-то действий.
Пример использования
Задача
Подключиться к браузеру Chrome и перейти по ссылке.
Решение
Воспользоваться действиями "Подключиться к открытому браузеру", "Перейти по URL".
Реализация
- Собрать схему робота, состоящую из действий: "Подключиться к открытому браузеру", "Перейти по URL".
- Настроить параметр для действия "Подключиться к открытому браузеру"
Настроить параметры действия "Перейти по URL". В поле "Контекст" выбрать контекст действия "Подключиться к открытому браузеру". В поле "Адрес страницы" указать адрес по которому нужно перейти. Сделать активным поле “В новой вкладке?”
- Нажать на кнопку "Старт" в верхней панели.
Результат
Программный робот отработал успешно. Выполнено подключение к открытому браузеру и переход по ссылке.
Вид браузера после перехода по ссылке.
- The browser must be minimized before running the action.
- If there are multiple tabs open in a browser, the action can connect to any of them. If multiple browsers are open, the action connects to the instance that is launched first.
Additionally:
- If multiple tabs are open, the robot can connect to any tab.
- There will be no robot-controlled notification in the browser window.
- After the robot finishes, the browser page will remain open unless some other action is taken.
Example of use
Task
Connect to your Chrome browser and follow the link.
Solution
Use the "Connect to an open browser", "Navigate" actions.
Implementation
- Assemble a robot scheme consisting of the actions: "Connect to an open browser", "Navigate".
- Set a parameters for the "Connect to open browser" action
Customize the parameters of the "Navigate" action. In the "Context" field, select the context of the "Connect to an open browser" action. In the "Address" field, specify the address you want to go to. Make the "In a new tab?" field active.
- Click on the "Start" button in the top panel.
Result
The program robot completed successfully. Connection to an open browser and clicking on the link was performed.
Browser view after clicking on the link.