Skip to content

Commit 4768e7b

Browse files
committed
Updated documentation explaining the new service class
1 parent 138e533 commit 4768e7b

File tree

2 files changed

+58
-4
lines changed

2 files changed

+58
-4
lines changed

src/SeleniumLibrary/__init__.py

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ class SeleniumLibrary(DynamicCore):
322322
https://robocon.io/, https://github.com/robotframework/'
323323
and 'https://github.com/.
324324
325-
= Browser and Driver options =
325+
= Browser and Driver options and service class =
326326
327327
This section talks about how to configure either the browser or
328-
the driver using the options ans service arguments of the `Open
328+
the driver using the options and service arguments of the `Open
329329
Browser` keyword.
330330
331331
== Configuring the browser using the Selenium Options ==
@@ -404,6 +404,33 @@ class SeleniumLibrary(DynamicCore):
404404
is opened, the test can interact with the embedded web-content of
405405
the system under test.
406406
407+
== Configuring the driver using the Service class ==
408+
409+
With the ``service`` argument, one can setup and configure the driver. For example
410+
one can set the driver location and/port or specify the command line arguments. There
411+
are several browser specific attributes related to logging as well. For the various
412+
Service Class attributes refer to
413+
[https://www.selenium.dev/documentation/webdriver/drivers/service/|the Selenium documentation]
414+
. Currently the ``service`` argument only accepts Selenium service in the string format.
415+
416+
=== Service string format ===
417+
418+
The string format allows for defining Selenium service attributes
419+
and their values in the `Open Browser` keyword. The attributes names
420+
are case and space sensitive and must match to the Selenium attributes
421+
names. Attributes are defined in a similar way as in Python: attribute
422+
name, equal sign, and attribute value. Example, `port=1234`. Multiple
423+
attributes must be separated by a semicolon. Example:
424+
`executable_path='/path/to/driver';port=1234`. Don't have duplicate
425+
attributes, like `service_args=['--append-log', '--readable-timestamp'];
426+
service_args=['--log-level=DEBUG']` as the second will override the first.
427+
Instead combine them as in
428+
`service_args=['--append-log', '--readable-timestamp', '--log-level=DEBUG']`
429+
430+
Arguments allow defining Python data types and arguments are
431+
evaluated by using Python. Strings must be quoted with single
432+
or double quotes, example "value" or 'value'
433+
407434
= Timeouts, waits, and delays =
408435
409436
This section discusses different ways how to wait for elements to

utest/test/api/approved_files/PluginDocumentation.test_many_plugins.approved.txt

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,10 @@ contains the following items: https://robotframework.org/,
264264
https://robocon.io/, https://github.com/robotframework/'
265265
and 'https://github.com/.
266266

267-
= Browser and Driver options =
267+
= Browser and Driver options and service class =
268268

269269
This section talks about how to configure either the browser or
270-
the driver using the options ans service arguments of the `Open
270+
the driver using the options and service arguments of the `Open
271271
Browser` keyword.
272272

273273
== Configuring the browser using the Selenium Options ==
@@ -346,6 +346,33 @@ applications which utilize the
346346
is opened, the test can interact with the embedded web-content of
347347
the system under test.
348348

349+
== Configuring the driver using the Service class ==
350+
351+
With the ``service`` argument, one can setup and configure the driver. For example
352+
one can set the driver location and/port or specify the command line arguments. There
353+
are several browser specific attributes related to logging as well. For the various
354+
Service Class attributes refer to
355+
[https://www.selenium.dev/documentation/webdriver/drivers/service/|the Selenium documentation]
356+
. Currently the ``service`` argument only accepts Selenium service in the string format.
357+
358+
=== Service string format ===
359+
360+
The string format allows for defining Selenium service attributes
361+
and their values in the `Open Browser` keyword. The attributes names
362+
are case and space sensitive and must match to the Selenium attributes
363+
names. Attributes are defined in a similar way as in Python: attribute
364+
name, equal sign, and attribute value. Example, `port=1234`. Multiple
365+
attributes must be separated by a semicolon. Example:
366+
`executable_path='/path/to/driver';port=1234`. Don't have duplicate
367+
attributes, like `service_args=['--append-log', '--readable-timestamp'];
368+
service_args=['--log-level=DEBUG']` as the second will override the first.
369+
Instead combine them as in
370+
`service_args=['--append-log', '--readable-timestamp', '--log-level=DEBUG']`
371+
372+
Arguments allow defining Python data types and arguments are
373+
evaluated by using Python. Strings must be quoted with single
374+
or double quotes, example "value" or 'value'
375+
349376
= Timeouts, waits, and delays =
350377

351378
This section discusses different ways how to wait for elements to

0 commit comments

Comments
 (0)