@@ -264,6 +264,88 @@ contains the following items: https://robotframework.org/,
264264https://robocon.io/, https://github.com/robotframework/'
265265and 'https://github.com/.
266266
267+ = Browser and Driver options =
268+
269+ This section talks about how to configure either the browser or
270+ the driver using the options ans service arguments of the `Open
271+ Browser` keyword.
272+
273+ == Configuring the browser using the Selenium Options ==
274+
275+ As noted within the keyword documentation for `Open Browser`, its
276+ ``options`` argument accepts Selenium options in two different
277+ formats: as a string and as Python object which is an instance of
278+ the Selenium options class.
279+
280+ === Options string format ===
281+
282+ The string format allows defining Selenium options methods
283+ or attributes and their arguments in Robot Framework test data.
284+ The method and attributes names are case and space sensitive and
285+ must match to the Selenium options methods and attributes names.
286+ When defining a method, it must be defined in a similar way as in
287+ python: method name, opening parenthesis, zero to many arguments
288+ and closing parenthesis. If there is a need to define multiple
289+ arguments for a single method, arguments must be separated with
290+ comma, just like in Python. Example: `add_argument("--headless")`
291+ or `add_experimental_option("key", "value")`. Attributes are
292+ defined in a similar way as in Python: attribute name, equal sign,
293+ and attribute value. Example, `headless=True`. Multiple methods
294+ and attributes must be separated by a semicolon. Example:
295+ `add_argument("--headless");add_argument("--start-maximized")`.
296+
297+ Arguments allow defining Python data types and arguments are
298+ evaluated by using Python
299+ [https://docs.python.org/3/library/ast.html#ast.literal_eval|ast.literal_eval].
300+ Strings must be quoted with single or double quotes, example "value"
301+ or 'value'. It is also possible to define other Python builtin
302+ data types, example `True` or `None`, by not using quotes
303+ around the arguments.
304+
305+ The string format is space friendly. Usually, spaces do not alter
306+ the defining methods or attributes. There are two exceptions.
307+ In some Robot Framework test data formats, two or more spaces are
308+ considered as cell separator and instead of defining a single
309+ argument, two or more arguments may be defined. Spaces in string
310+ arguments are not removed and are left as is. Example
311+ `add_argument ( "--headless" )` is same as
312+ `add_argument("--headless")`. But `add_argument(" --headless ")` is
313+ not same same as `add_argument ( "--headless" )`, because
314+ spaces inside of quotes are not removed. Please note that if
315+ options string contains backslash, example a Windows OS path,
316+ the backslash needs escaping both in Robot Framework data and
317+ in Python side. This means single backslash must be writen using
318+ four backslash characters. Example, Windows path:
319+ "C:\path\to\profile" must be written as
320+ "C:\\\\path\\\to\\\\profile". Another way to write
321+ backslash is use Python
322+ [https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals|raw strings]
323+ and example write: r"C:\\path\\to\\profile".
324+
325+ === Selenium Options as Python class ===
326+
327+ As last format, ``options`` argument also supports receiving
328+ the Selenium options as Python class instance. In this case, the
329+ instance is used as-is and the SeleniumLibrary will not convert
330+ the instance to other formats.
331+ For example, if the following code return value is saved to
332+ `${options}` variable in the Robot Framework data:
333+ | options = webdriver.ChromeOptions()
334+ | options.add_argument('--disable-dev-shm-usage')
335+ | return options
336+
337+ Then the `${options}` variable can be used as an argument to
338+ ``options``.
339+
340+ Example the ``options`` argument can be used to launch Chomium-based
341+ applications which utilize the
342+ [https://bitbucket.org/chromiumembedded/cef/wiki/UsingChromeDriver|Chromium Embedded Framework]
343+ . To launch Chromium-based application, use ``options`` to define
344+ `binary_location` attribute and use `add_argument` method to define
345+ `remote-debugging-port` port for the application. Once the browser
346+ is opened, the test can interact with the embedded web-content of
347+ the system under test.
348+
267349= Timeouts, waits, and delays =
268350
269351This section discusses different ways how to wait for elements to
0 commit comments