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

Ключ

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

...

Action parameters

Input parameters

Browser - The Browser                                     The browser to be opened

Properties - Properties                                  A list of browser properties and their values that will be set when the browser is launched

Explicitly wait - The wait                             The time to wait for the properties of individual elements to change

Background mode - Opens mode                     Opens in invisible mode. Internet Explorer does not support this setting

URL - The URL                                             The URL that should be navigated to when the browser is opened

Save in - The 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

. Optional.

Default is Chrome

.


Выпадающий список:

  • Chrome
  • Яндекс
  • Firefox
  • Internet Explorer
  • Edge (chromium)
Robin.StringChromeNo
PropertiesList of browser properties and their values ​​that will be set when the browser starts

В JSON формате, описывающий список свойств браузера и их значений, которые будут установлены при запуске

Если параметр заполнен, его значения имеют преимущества перед значениями остальных полей

Подключить расширения и задать профиль можно через этот параметр

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

Задается предельное значение времени ожидания для использования по умолчанию в действиях группы, определяющее время доступа к элементам

Измеряется в миллисекундах

Robin.Numeric10000No
Background modeBackground mode
Internet Explorer не поддерживает данную настройку (вопрос)
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
Экземпляр браузера, с которым будет работать Selenium
Robin.SeleniumBrowser context

Special conditions of use 

Example of filling in the "Properties" field (filled in automatically by recording actions in Recorder). 

Без форматирования
{"acceptInsecureCerts":true,"browserName":"chrome","goog: loggingPrefs":{"browser":"ALL"},"timeouts":{"implicit":0,"pageLoad":300003,"script":30003},"unhandledPromptBehavior":"dismiss","goog:chromeOptions":{"args":["disable-popup-blocking","disable-notifications","no-sandbox"],"extensions":[]}}

The browser properties look something like the following:


Блок кода
languageerl
themeEclipse
{"acceptInsecureCerts":true,

...



"browserName":"chrome",

...



"goog: loggingPrefs":{"browser":"ALL"},

...



"timeouts":{"implicit":0,"pageLoad":300003,"script":30003},

...



"unhandledPromptBehavior":"dismiss",

...



"goog:chromeOptions":{"args":["disable-popup-blocking","disable-notifications","no-sandbox","--disable-blink-features=AutomationControlled"],"extensions":[]}}

 


Примечание

Note: In folder/file paths, the backslash must be escaped (C:\\Users\\User or C:/Users/User ). 

Most of the features are available through the ChromeOptions object (highlighted in bold in the properties). It is used to control various properties of the browser driver. Therefore, we are more interested in this object.

Denoted as follows:

Без форматирования
"goog:chromeOptions":{"Option 1": Value 1, "Option 2": Value 2}.

Option values can be of the following types:

...

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.

 (https://peter.sh/experiments/chromium-command-line-switches/)Получение crx расширения.docx

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

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.

The Chrome/Yandex startup part of the properties looks like this:

Блок кода
languageerl
themeEclipse
{
панель
"goog:chromeOptions":{
   

   "args":[
   

    "-disable-blink-features=AutomationControlled"
   
,
    "disable-popup-blocking",
   

    "disable-notifications",
   

    "disable-infobars"
   
,
    "disable-gpu",
   

    "no-sandbox",
   

    "disable-extensions",
    

    "start maximized",
   

    "user-
date
data-dir=C^//Users//robin_user//APPData//Local//Yandex//YandexBrowser//User Data"
   
,
    "profile-directory=Profile 1"
,

 ]

 

 ],
 "excludeSwitches":["enable-automation"],
 

 "extensions":[]
 

 }

}


Подсказка

PLEASE NOTE!

The string "excludeSwitches":["enable-automation"] allows you to disable checking for automated software control, and the"disable-extensions" argument blocks plugins from loading. 

The plugin loading process checks to see if the browser is running automated software.

In order to load a plugin, you must disable the check for automated software management and remove the "disable-extensions" argument.

...

Кроме того, вместо значения "eager" можно указать значение "none", но тогда есть риск что страница не загрузится. Значение "eager" ждет только загрузки DOM страницы, не ожидая загрузки скриптов, изображений и других ресурсов, значение "none" вообще не ждет.

Example of use

Task

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

Solution

Use the "Open Browser" action. 

Implementation

  1. Open the "Browsers" action group
  2. Open the "Windows, tabs, frames" subgroup 
  3. Add the "Open Browser" action to the workspace.  Image Removed
    Image Added
  4. Set the action parameters:
    1. "Browser" field. Select a browser from the drop-down list that you want to open. 
    2. "Properties" field. Specify a JSON-formatted file using a template that will set the prioritized properties to launch the browser. 
    3. "Explicitly wait" field. Set the timeout time to 1000ms.
    4. "Background mode" field. The value is "True" or "False". Leave "False" to open the browser in visible mode.  
    5. "URL" field. Specify the URL that will be used to open the browser - https://yandexya.ru/
    6. The "Save in" field. Specify the address on the PC where the downloaded files will be saved if the download link is specified in the "Address" parameter. 
      Image Modified

...

  1. Add the "Close browser" action to the workspace. Fill in the "Context" parameter.

...

  1. Image Modified

...

  1. Launch the robot using the "Start" button in the top panel.

Result

The Edge browser was opened in visible mode, and the page was navigated to to https://yandexya.ru/
Image Modified