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

Ключ

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

...

Connect to an open browser Version 7 (Java)

Группа действийAction group: Браузеры Browsers 

Описание

Действие подключается к заранее открытому окну браузера. Не происходит подключения к окнам, которые открыли или к которым подключились другие роботы.

Иконка действия

Image Removed

Параметры

Входные параметры

...

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

Image Added

Parameters

Input parameters

  1. Browser - The name of the browser to connect to. For example: Chrome.
  2. Address - The default IP to connect to. The default value is localhost.
  3. 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

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
BrowserThe name of the browser to connect to.Robin.String
Yes
AddressIP address for connection. Default is localhost.Robin.String
No
PortIP address for connection. Default is 9222.Robin.Numeric
No
Results
ContextThe browser instance that actions will work with.Robin.SeleniumBrowser context

Special conditions of use 

Parameters may vary depending on the version.

The RobinRecorder 0.2 browser extension must be installed beforehand.

Image Added

The following steps must be performed for the action to work correctly:

  1. Right-click on the browser shortcut and add

...

Выходные параметры

На выходе получаем экземпляр браузера, с которым будут работать действия.

Настройки

...

Browser

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

Выпадающий список из элементов: Chrome, Yandex

...

IP по умолчанию к которому надо подключиться. Значение по умолчанию localhost

...

Context

...

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

Параметры могут меняться в зависимости от версии.

Предварительно должно быть установлено расширение в  браузере RobinRecorder 0.2

Image Removed

Для корректной отработки действия необходимо выполнить следующие действия:

  1. Нажать правой кнопкой мыши по ярлыку браузера и добавить в поле "Объект" параметр  --remote-debugging-port=9222
    Нажать на кнопку "ОК".
    Image Removed
    to the Object field
    Click on the "OK" button.
    Image Added
  2. 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
  3. Установить веб-драйвера для браузеров 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 linkshttps://github.com/yandex/YandexDriver/releases и https://chromedriver.chromium.org/
  4. Проверить, что в папке .robin имеется файл env.cfg с указанными драйверами и их версиямиVerify that there is an env.cfg file in the .robin folder with the specified drivers and their versions
  5. Перед запуском действия браузер должен быть свернутым. 
  6. Если в браузере открыто несколько вкладок, действие может подключиться к любой из них. Если будет открыто несколько браузеров, действие подключается к тому экземпляру, который запущен первым.

Дополнительно:

  1. Если открыто несколько вкладок, то робот может подключиться к любой вкладке. 
  2. Уведомления о работе под управлением робота в окне браузера не будет.
  3. После окончания работы робота страница браузера так и останется открытой, если не будет произведено еще каких-то действий. 

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

Задача

Подключиться к браузеру Chrome и перейти по ссылке. 

Решение

Воспользоваться действиями "Подключиться к открытому браузеру", "Перейти по URL". 

Реализация

  1. Собрать схему робота, состоящую из действий: "Подключиться к открытому браузеру", "Перейти по URL". 
    Image Removed
  2. Настроить параметр для действия "Подключиться к открытому браузеру" 
    Image Removed
  3. Настроить параметры действия "Перейти по URL". В поле "Контекст" выбрать контекст действия "Подключиться к открытому браузеру". В поле "Адрес страницы" указать адрес по которому нужно перейти. Сделать активным  поле “В новой вкладке?”
    Image Removed

  4. Нажать на кнопку "Старт" в верхней панели. 

Результат

Программный робот отработал успешно. Выполнено подключение к открытому браузеру и переход по ссылке. 

Image Removed

Вид браузера после перехода по ссылке. 

  1. The browser must be minimized before running the action. 
  2. 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:

  1. If multiple tabs are open, the robot can connect to any tab. 
  2. There will be no robot-controlled notification in the browser window.
  3. 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

  1. Assemble a robot scheme consisting of the actions: "Connect to an open browser", "Navigate". 
    Image Added
  2. Set a parameters for the "Connect to open browser" action  
    Image Added
  3. 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.
    Image Added

  4. 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. 

Image Added

Browser view after clicking on the link. 

Image Added

 Image Removed