@@ -78,7 +78,7 @@ class SeleniumLibrary(DynamicCore):
78
78
79
79
=== Default locator strategy ===
80
80
81
- By default locators are considered to use the keyword specific default
81
+ By default, locators are considered to use the keyword specific default
82
82
locator strategy. All keywords support finding elements based on ``id``
83
83
and ``name`` attributes, but some keywords support additional attributes
84
84
or other values that make sense in their context. For example, `Click
@@ -106,7 +106,7 @@ class SeleniumLibrary(DynamicCore):
106
106
107
107
The explicit locator strategy is specified with a prefix using either
108
108
syntax ``strategy:value`` or ``strategy=value``. The former syntax
109
- is preferred, because the latter is identical to Robot Framework's
109
+ is preferred because the latter is identical to Robot Framework's
110
110
[http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#named-argument-syntax|
111
111
named argument syntax] and that can cause problems. Spaces around
112
112
the separator are ignored, so ``id:foo``, ``id: foo`` and ``id : foo``
@@ -138,7 +138,7 @@ class SeleniumLibrary(DynamicCore):
138
138
Different locator strategies have different pros and cons. Using ids,
139
139
either explicitly like ``id:foo`` or by using the `default locator
140
140
strategy` simply like ``foo``, is recommended when possible, because
141
- the syntax is simple and locating elements by an id is fast for browsers.
141
+ the syntax is simple and locating elements by id is fast for browsers.
142
142
If an element does not have an id or the id is not stable, other
143
143
solutions need to be used. If an element has a unique tag name or class,
144
144
using ``tag``, ``class`` or ``css`` strategy like ``tag:h1``,
@@ -198,8 +198,8 @@ class SeleniumLibrary(DynamicCore):
198
198
199
199
This keyword is a reimplementation of the basic functionality of the
200
200
``id`` locator where ``${browser}`` is a reference to a WebDriver
201
- instance and ``${locator}`` is name of the locator strategy. To use
202
- this locator it must first be registered by using the
201
+ instance and ``${locator}`` is the name of the locator strategy. To use
202
+ this locator, it must first be registered by using the
203
203
`Add Location Strategy` keyword:
204
204
205
205
| `Add Location Strategy` | custom | Custom Locator Strategy |
@@ -214,41 +214,41 @@ class SeleniumLibrary(DynamicCore):
214
214
215
215
= Browser and Window =
216
216
217
- There is different conseptual meaning when SeleniumLibrary talks
218
- windows and browsers. This chapter explains those differences.
217
+ There is different conceptual meaning when SeleniumLibrary talks
218
+ about windows or browsers. This chapter explains those differences.
219
219
220
220
== Browser ==
221
221
222
222
When `Open Browser` or `Create WebDriver` keyword is called, it
223
223
will create a new Selenium WebDriver instance by using the
224
224
[https://www.seleniumhq.org/docs/03_webdriver.jsp|Selenium WebDriver]
225
- API. In SeleniumLibrary terms, a new broser is created. It is
225
+ API. In SeleniumLibrary terms, a new browser is created. It is
226
226
possible to start multiple independent browsers (Selenium Webdriver
227
227
instances) at the same time, by calling `Open Browser` or
228
228
`Create WebDriver` multiple times. These browsers are usually
229
- independent to each other and do not share data like cookies,
230
- sessions or profiles. Typicall when browser starts, it
231
- creates a single window in the desktop .
232
-
229
+ independent of each other and do not share data like cookies,
230
+ sessions or profiles. Typically when the browser starts, it
231
+ creates a single window which is shown to the user .
232
+
233
233
== Window ==
234
234
235
235
Windows are the part of a browser that loads the web site and presents
236
- it to the user. All content of the site is content of the window.
237
- Windows are children of a WebDriver instance, in SeleniumLibrary
238
- WebDriver is referred as browser . One browser may have multiple
239
- windows. Windows can appear as tabs or as separate windows with
240
- different position and size. Windows belonning to the same browser
236
+ it to the user. All content of the site is the content of the window.
237
+ Windows are children of a browser. In SeleniumLibrary browser is a
238
+ synonym for WebDriver instance . One browser may have multiple
239
+ windows. Windows can appear as tabs, as separate windows or pop-ups with
240
+ different position and size. Windows belonging to the same browser
241
241
typically share the sessions detail, like cookies. If there is a
242
242
need to separate sessions detail, example login with two different
243
- users, two browser (Selenium WebDriver instances) must be created.
243
+ users, two browsers (Selenium WebDriver instances) must be created.
244
244
New windows can be opened example by the application under test or
245
245
by example `Execute Javascript` keyword:
246
246
247
247
| `Execute Javascript` window.open() # Opens a new window with location about:blank
248
248
249
- In the example in below opens multiple browser and windows,
249
+ The example below opens multiple browsers and windows,
250
250
to demonstrate how the different keywords can be used to interact
251
- with a browser and windows attached to the browser .
251
+ with browsers, and windows attached to these browsers .
252
252
253
253
Structure:
254
254
| BrowserA
@@ -263,39 +263,39 @@ class SeleniumLibrary(DynamicCore):
263
263
| `Open Browser` | https://robotframework.org | ${BROWSER} | alias=BrowserA | # BrowserA with first window is opened. |
264
264
| `Execute Javascript` | window.open() | | | # In BrowserA second window is opened. |
265
265
| `Switch Window` | locator=NEW | | | # Switched to second window in BrowserA |
266
- | `Go To` | https://robocon.io | | | # Second window navigates to to robocon site. |
266
+ | `Go To` | https://robocon.io | | | # Second window navigates to robocon site. |
267
267
| `Execute Javascript` | window.open() | | | # In BrowserA third window is opened. |
268
268
| ${handle} | `Switch Window` | locator=NEW | | # Switched to third window in BrowserA |
269
269
| `Go To` | https://github.com/robotframework/ | | | # Third windows goes to robot framework github site. |
270
270
| `Open Browser` | https://github.com | ${BROWSER} | alias=BrowserB | # BrowserB with first windows is opened. |
271
271
| ${location} | `Get Location` | | | # ${location} is: https://www.github.com |
272
272
| `Switch Window` | ${handle} | browser=BrowserA | | # BrowserA second windows is selected. |
273
273
| ${location} | `Get Location` | | | # ${location} = https://robocon.io/ |
274
- | @{locations 1} | `Get Locations` | | | # By default lists locations under the currectly active browser. |
274
+ | @{locations 1} | `Get Locations` | | | # By default, lists locations under the currectly active browser (BrowserA). |
275
275
| @{locations 2} | `Get Locations` | browser=ALL | | # By using browser=ALL argument keyword list all locations from all browsers. |
276
-
276
+
277
277
The above example, @{locations 1} contains the following items:
278
278
https://robotframework.org/, https://robocon.io/ and
279
279
https://github.com/robotframework/'. The @{locations 2}
280
280
contains the following items: https://robotframework.org/,
281
281
https://robocon.io/, https://github.com/robotframework/'
282
282
and 'https://github.com/.
283
283
284
- = Timeouts, waits and delays =
284
+ = Timeouts, waits, and delays =
285
285
286
286
This section discusses different ways how to wait for elements to
287
287
appear on web pages and to slow down execution speed otherwise.
288
288
It also explains the `time format` that can be used when setting various
289
- timeouts, waits and delays.
289
+ timeouts, waits, and delays.
290
290
291
291
== Timeout ==
292
292
293
293
SeleniumLibrary contains various keywords that have an optional
294
294
``timeout`` argument that specifies how long these keywords should
295
295
wait for certain events or actions. These keywords include, for example,
296
296
``Wait ...`` keywords and keywords related to alerts. Additionally
297
- `Execute Async Javascript`. although it does not have ``timeout``,
298
- argument, uses timeout to define how long asynchronous JavaScript
297
+ `Execute Async Javascript`. Although it does not have ``timeout``,
298
+ argument, uses a timeout to define how long asynchronous JavaScript
299
299
can run.
300
300
301
301
The default timeout these keywords use can be set globally either by
@@ -318,7 +318,7 @@ class SeleniumLibrary(DynamicCore):
318
318
Selenium execution speed can be slowed down globally by using `Set
319
319
Selenium speed` keyword. This functionality is designed to be used for
320
320
demonstrating or debugging purposes. Using it to make sure that elements
321
- appear on a page is not a good idea, and the above explained timeouts
321
+ appear on a page is not a good idea. The above- explained timeouts
322
322
and waits should be used instead.
323
323
324
324
See `time format` below for supported syntax.
@@ -334,23 +334,23 @@ class SeleniumLibrary(DynamicCore):
334
334
= Run-on-failure functionality =
335
335
336
336
SeleniumLibrary has a handy feature that it can automatically execute
337
- a keyword if any of its own keywords fails. By default it uses the
337
+ a keyword if any of its own keywords fails. By default, it uses the
338
338
`Capture Page Screenshot` keyword, but this can be changed either by
339
339
using the `Register Keyword To Run On Failure` keyword or with the
340
340
``run_on_failure`` argument when `importing` the library. It is
341
341
possible to use any keyword from any imported library or resource file.
342
342
343
- The run-on-failure functionality can be disabled by using a special
344
- value ``NOTHING`` or anything considered false (see `Boolean arguments`)
343
+ The run-on-failure functionality can be disabled by using a special value
344
+ ``NOTHING`` or anything considered false (see `Boolean arguments`)
345
345
such as ``NONE``.
346
346
347
347
= Boolean arguments =
348
348
349
349
Some keywords accept arguments that are handled as Boolean values true or
350
350
false. If such an argument is given as a string, it is considered false if
351
351
it is either empty or case-insensitively equal to ``false``, ``no``, ``off``,
352
- ``0`` or ``none``. Other strings are considered true regardless their value, and
353
- other argument types are tested using same
352
+ ``0`` or ``none``. Other strings are considered true regardless of their value and
353
+ other argument types are tested using the same
354
354
[https://docs.python.org/3/library/stdtypes.html#truth-value-testing|rules as in Python].
355
355
356
356
True examples:
@@ -379,22 +379,22 @@ class SeleniumLibrary(DynamicCore):
379
379
[https://seleniumhq.github.io/selenium/docs/api/py/webdriver_support/selenium.webdriver.support.event_firing_webdriver.html#module-selenium.webdriver.support.event_firing_webdriver|EventFiringWebDriver].
380
380
See the Selenium and SeleniumLibrary
381
381
[https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/extending.rst#EventFiringWebDriver|EventFiringWebDriver support]
382
- documentation for futher details.
382
+ documentation for further details.
383
383
384
384
EventFiringWebDriver is new in SeleniumLibrary 4.0
385
385
386
386
= Thread support =
387
387
388
- SeleniumLibrary is not thread safe. This is mainly due because the underlying
388
+ SeleniumLibrary is not thread- safe. This is mainly due because the underlying
389
389
[https://github.com/SeleniumHQ/selenium/wiki/Frequently-Asked-Questions#q-is-webdriver-thread-safe|
390
- Selenium tool is not thread safe] within one browser/driver instance.
390
+ Selenium tool is not thread- safe] within one browser/driver instance.
391
391
Because of the limitation in the Selenium side, the keywords or the
392
- API provided by the SeleniumLibrary is not thread safe.
392
+ API provided by the SeleniumLibrary is not thread- safe.
393
393
394
394
= Plugins =
395
395
396
396
SeleniumLibrary offers plugins as a way to modify and add library keywords and modify some of the internal
397
- functionality without creating new library or hacking the source code. See
397
+ functionality without creating a new library or hacking the source code. See
398
398
[https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/extending.rst#Plugins|plugin API]
399
399
documentation for further details.
400
400
@@ -519,7 +519,7 @@ def register_driver(self, driver, alias):
519
519
def failure_occurred (self ):
520
520
"""Method that is executed when a SeleniumLibrary keyword fails.
521
521
522
- By default executes the registered run-on-failure keyword.
522
+ By default, executes the registered run-on-failure keyword.
523
523
Libraries extending SeleniumLibrary can overwrite this hook
524
524
method if they want to provide custom functionality instead.
525
525
"""
@@ -552,7 +552,7 @@ def find_element(self, locator, parent=None):
552
552
See library documentation for the supported locator syntax.
553
553
:type locator: str or selenium.webdriver.remote.webelement.WebElement
554
554
:param parent: Optional parent `WebElememt` to search child elements
555
- from. By default search starts from the root using `WebDriver`.
555
+ from. By default, search starts from the root using `WebDriver`.
556
556
:type parent: selenium.webdriver.remote.webelement.WebElement
557
557
:return: Found `WebElement`.
558
558
:rtype: selenium.webdriver.remote.webelement.WebElement
@@ -567,7 +567,7 @@ def find_elements(self, locator, parent=None):
567
567
See library documentation for the supported locator syntax.
568
568
:type locator: str or selenium.webdriver.remote.webelement.WebElement
569
569
:param parent: Optional parent `WebElememt` to search child elements
570
- from. By default search starts from the root using `WebDriver`.
570
+ from. By default, search starts from the root using `WebDriver`.
571
571
:type parent: selenium.webdriver.remote.webelement.WebElement
572
572
:return: list of found `WebElement` or e,mpty if elements are not found.
573
573
:rtype: list[selenium.webdriver.remote.webelement.WebElement]
0 commit comments