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

Ключ

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

...

Action icon

Action parameters

Input parameters

Browser                                     The browser to be opened

...

Save in                                         The path to the folder where files should be saved when downloaded

Output parameters

Context The context of the open browser session that will be accessed by further actions

...

PropertyDescriptionTypeFilling exampleMandatory field
Parameters
Browser

Browser selection

Default is Chrome


Dropdown list:

  • Chrome
  • Yandex
  • Firefox
  • Internet Explorer
  • Edge (chromium)
Robin.StringChromeNo
PropertiesList of browser properties and their values ​​that will be set when the browser starts

In JSON format, describing a list of browser properties and their values to be set at launch

If the parameter is populated, its values take precedence over the values of the other fields

You can connect extensions and set the profile through this parameter

Robin.StringJSON по шаблонуNo
Explicitly waitTime to wait for changes in the properties of individual elements

Specifies a waiting time limit value to be used by default in group actions, determining the time to access items

Measured in milliseconds

Robin.Numeric10000No
Background modeBackground mode
Internet Explorer does not support this setting (вопрос)
Robin.BooleantrueNo
URLURL to be navigated after opening the browserRobin.Stringhttps://google.com/No
Save inPath to folder to save filesRobin.FolderPathC:\doc\imgNo
Results
ContextThe browser instance that Selenium will work with
Browser instance with which Selenium will work
Robin.SeleniumBrowser context

...

In the example, at the very beginning of the text, the options "args" and "extensions" are used. The entire list of options of the ChromeOptions object is shown in the table. The most frequently used options are highlighted in green.

Option name

Type

By default

Option description  

args 

List of strings


A list of command line arguments used when launching Chrome. Arguments with a related value must be separated by a sign '=' (for example, ‘args’ : ['start-maximized', 'user-data-dir=C:/Users/User/AppData/Local/Google/Chrome/User Data/Default']). A list of Chrome arguments is provided here.

binary

String


Path to the Chrome executable file to use

extensions

List of strings


A list of Chrome extensions to install on startup. Each item in the list must have a packaged Chrome extension in base-64 (.crx) encoding

Getting a crx extension

localState

Dictionary


A dictionary with each entry consisting of the name of the preference and its value. These settings are applied to the local state file in the user data folder.

prefs

Dictionary


A dictionary with each entry consisting of the name of the preference and its value. These preferences apply only to the user profile in use. For examples, see the "Preferences" file in the Chrome user data directory (C:\Users\{User}\AppData\Local\Google\Chrome\User Data\{GoogleUser}).

detach

Boolean type

false 

If false, Chrome will be closed when ChromeDriver is removed, regardless of whether the session is terminated. If the value is true, Chrome will only be closed if the session is completed (or closed). Note that if the value is true and the session is not terminated, ChromeDriver will not be able to clean up the temporary user data directory used by the running Chrome instance.

debuggerAddress

String


The address of the Chrome debugger server to connect to as <hostname/ip:port>, for example '127.0.0.1:38947'

excludeSwitches

List of strings


List Chrome command line switches to prevent ChromeDriver from being passed by default when Chrome starts. Specify switches without the prefix --.

minidumpPath 

String


A directory for storing Chrome mini-dumps (Supported on Linux only).

mobileEmulation

Dictionary


A dictionary with the value "deviceName" or values for "deviceMetrics" and "userAgent". See Mobile device emulation for more information. https://chromedriver.chromium.org/mobile-emulation

Example: "mobileEmulation": {"deviceName": "iPhone 12 Pro"}

windowTypes

List of strings


A list of window types to be displayed in the window descriptor list. To access <webview> elements, include "webview" in this list.

...

Alternatively, you can specify "none" instead of "eager", but then there is a risk that the page will not load. The "eager" value only waits for the page DOM to load, without waiting for scripts, images and other resources to load, the "none" value does not wait at all.

Пример 2. Сообщение об отсутствии драйвера

При выполнении действия "Открыть браузер" при использовании в файле env.cfg кодировки, отличной от UTF-8, например, с кириллицей - может возникнуть ситуация, когда при наличии драйвера, появляется сообщение об его отсутствии:
Image Added

Результат: действие завершается с ошибкой, потому что драйвер не найден.

Причиной является проблема в кодировке файла env.cfg. В нашем примере на виртуальной машине файл был в кодировке Windows-1251:
Image Added

Для того, чтобы отработало действие "Открыть браузер", нужно сконвертировать и пересохранить файл в кодировке UTF-8:
Image Added

Действие будет запущено, робот завершится без ошибки. Браузер откроется.

Информация
Эту ситуацию можно воспроизвести с любой папкой, у которой есть кириллица в пути. При этом не обязательно, чтобы сам пользователь был записан кириллицей.


Example of use

Task

Open the selected browser on the given page, get the action context for working with actions of the "Browsers" group.

...