Skip to content

Commit 2c5aeb6

Browse files
committed
fixed typos, punctuation, and formulation in Keyword documentation and library documentation.
1 parent 3227b07 commit 2c5aeb6

File tree

15 files changed

+237
-235
lines changed

15 files changed

+237
-235
lines changed

src/SeleniumLibrary/__init__.py

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class SeleniumLibrary(DynamicCore):
7878
7979
=== Default locator strategy ===
8080
81-
By default locators are considered to use the keyword specific default
81+
By default, locators are considered to use the keyword specific default
8282
locator strategy. All keywords support finding elements based on ``id``
8383
and ``name`` attributes, but some keywords support additional attributes
8484
or other values that make sense in their context. For example, `Click
@@ -106,7 +106,7 @@ class SeleniumLibrary(DynamicCore):
106106
107107
The explicit locator strategy is specified with a prefix using either
108108
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
110110
[http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#named-argument-syntax|
111111
named argument syntax] and that can cause problems. Spaces around
112112
the separator are ignored, so ``id:foo``, ``id: foo`` and ``id : foo``
@@ -138,7 +138,7 @@ class SeleniumLibrary(DynamicCore):
138138
Different locator strategies have different pros and cons. Using ids,
139139
either explicitly like ``id:foo`` or by using the `default locator
140140
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.
142142
If an element does not have an id or the id is not stable, other
143143
solutions need to be used. If an element has a unique tag name or class,
144144
using ``tag``, ``class`` or ``css`` strategy like ``tag:h1``,
@@ -198,8 +198,8 @@ class SeleniumLibrary(DynamicCore):
198198
199199
This keyword is a reimplementation of the basic functionality of the
200200
``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
203203
`Add Location Strategy` keyword:
204204
205205
| `Add Location Strategy` | custom | Custom Locator Strategy |
@@ -214,41 +214,41 @@ class SeleniumLibrary(DynamicCore):
214214
215215
= Browser and Window =
216216
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.
219219
220220
== Browser ==
221221
222222
When `Open Browser` or `Create WebDriver` keyword is called, it
223223
will create a new Selenium WebDriver instance by using the
224224
[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
226226
possible to start multiple independent browsers (Selenium Webdriver
227227
instances) at the same time, by calling `Open Browser` or
228228
`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+
233233
== Window ==
234234
235235
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
241241
typically share the sessions detail, like cookies. If there is a
242242
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.
244244
New windows can be opened example by the application under test or
245245
by example `Execute Javascript` keyword:
246246
247247
| `Execute Javascript` window.open() # Opens a new window with location about:blank
248248
249-
In the example in below opens multiple browser and windows,
249+
The example below opens multiple browsers and windows,
250250
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.
252252
253253
Structure:
254254
| BrowserA
@@ -263,39 +263,39 @@ class SeleniumLibrary(DynamicCore):
263263
| `Open Browser` | https://robotframework.org | ${BROWSER} | alias=BrowserA | # BrowserA with first window is opened. |
264264
| `Execute Javascript` | window.open() | | | # In BrowserA second window is opened. |
265265
| `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. |
267267
| `Execute Javascript` | window.open() | | | # In BrowserA third window is opened. |
268268
| ${handle} | `Switch Window` | locator=NEW | | # Switched to third window in BrowserA |
269269
| `Go To` | https://github.com/robotframework/ | | | # Third windows goes to robot framework github site. |
270270
| `Open Browser` | https://github.com | ${BROWSER} | alias=BrowserB | # BrowserB with first windows is opened. |
271271
| ${location} | `Get Location` | | | # ${location} is: https://www.github.com |
272272
| `Switch Window` | ${handle} | browser=BrowserA | | # BrowserA second windows is selected. |
273273
| ${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). |
275275
| @{locations 2} | `Get Locations` | browser=ALL | | # By using browser=ALL argument keyword list all locations from all browsers. |
276-
276+
277277
The above example, @{locations 1} contains the following items:
278278
https://robotframework.org/, https://robocon.io/ and
279279
https://github.com/robotframework/'. The @{locations 2}
280280
contains the following items: https://robotframework.org/,
281281
https://robocon.io/, https://github.com/robotframework/'
282282
and 'https://github.com/.
283283
284-
= Timeouts, waits and delays =
284+
= Timeouts, waits, and delays =
285285
286286
This section discusses different ways how to wait for elements to
287287
appear on web pages and to slow down execution speed otherwise.
288288
It also explains the `time format` that can be used when setting various
289-
timeouts, waits and delays.
289+
timeouts, waits, and delays.
290290
291291
== Timeout ==
292292
293293
SeleniumLibrary contains various keywords that have an optional
294294
``timeout`` argument that specifies how long these keywords should
295295
wait for certain events or actions. These keywords include, for example,
296296
``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
299299
can run.
300300
301301
The default timeout these keywords use can be set globally either by
@@ -318,7 +318,7 @@ class SeleniumLibrary(DynamicCore):
318318
Selenium execution speed can be slowed down globally by using `Set
319319
Selenium speed` keyword. This functionality is designed to be used for
320320
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
322322
and waits should be used instead.
323323
324324
See `time format` below for supported syntax.
@@ -334,23 +334,23 @@ class SeleniumLibrary(DynamicCore):
334334
= Run-on-failure functionality =
335335
336336
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
338338
`Capture Page Screenshot` keyword, but this can be changed either by
339339
using the `Register Keyword To Run On Failure` keyword or with the
340340
``run_on_failure`` argument when `importing` the library. It is
341341
possible to use any keyword from any imported library or resource file.
342342
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`)
345345
such as ``NONE``.
346346
347347
= Boolean arguments =
348348
349349
Some keywords accept arguments that are handled as Boolean values true or
350350
false. If such an argument is given as a string, it is considered false if
351351
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
354354
[https://docs.python.org/3/library/stdtypes.html#truth-value-testing|rules as in Python].
355355
356356
True examples:
@@ -379,22 +379,22 @@ class SeleniumLibrary(DynamicCore):
379379
[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].
380380
See the Selenium and SeleniumLibrary
381381
[https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/extending.rst#EventFiringWebDriver|EventFiringWebDriver support]
382-
documentation for futher details.
382+
documentation for further details.
383383
384384
EventFiringWebDriver is new in SeleniumLibrary 4.0
385385
386386
= Thread support =
387387
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
389389
[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.
391391
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.
393393
394394
= Plugins =
395395
396396
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
398398
[https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/extending.rst#Plugins|plugin API]
399399
documentation for further details.
400400
@@ -519,7 +519,7 @@ def register_driver(self, driver, alias):
519519
def failure_occurred(self):
520520
"""Method that is executed when a SeleniumLibrary keyword fails.
521521
522-
By default executes the registered run-on-failure keyword.
522+
By default, executes the registered run-on-failure keyword.
523523
Libraries extending SeleniumLibrary can overwrite this hook
524524
method if they want to provide custom functionality instead.
525525
"""
@@ -552,7 +552,7 @@ def find_element(self, locator, parent=None):
552552
See library documentation for the supported locator syntax.
553553
:type locator: str or selenium.webdriver.remote.webelement.WebElement
554554
: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`.
556556
:type parent: selenium.webdriver.remote.webelement.WebElement
557557
:return: Found `WebElement`.
558558
:rtype: selenium.webdriver.remote.webelement.WebElement
@@ -567,7 +567,7 @@ def find_elements(self, locator, parent=None):
567567
See library documentation for the supported locator syntax.
568568
:type locator: str or selenium.webdriver.remote.webelement.WebElement
569569
: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`.
571571
:type parent: selenium.webdriver.remote.webelement.WebElement
572572
:return: list of found `WebElement` or e,mpty if elements are not found.
573573
:rtype: list[selenium.webdriver.remote.webelement.WebElement]

src/SeleniumLibrary/base/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def find_element(self, locator, tag=None, required=True, parent=None):
6363
true, return `None` otherwise.
6464
:type required: True or False
6565
:param parent: Optional parent `WebElememt` to search child elements
66-
from. By default search starts from the root using `WebDriver`.
66+
from. By default, search starts from the root using `WebDriver`.
6767
:type parent: selenium.webdriver.remote.webelement.WebElement
6868
:return: Found `WebElement` or `None` if element not found and
6969
`required` is false.
@@ -82,7 +82,7 @@ def find_elements(self, locator, tag=None, parent=None):
8282
:param tag: Limit searching only to these elements.
8383
:type tag: str
8484
:param parent: Optional parent `WebElememt` to search child elements
85-
from. By default search starts from the root using `WebDriver`.
85+
from. By default, search starts from the root using `WebDriver`.
8686
:type parent: selenium.webdriver.remote.webelement.WebElement
8787
:return: list of found `WebElement` or empty if elements are not found.
8888
:rtype: list[selenium.webdriver.remote.webelement.WebElement]

src/SeleniumLibrary/keywords/alert.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def input_text_into_alert(self, text, action=ACCEPT, timeout=None):
4646

4747
@keyword
4848
def alert_should_be_present(self, text='', action=ACCEPT, timeout=None):
49-
"""Verifies that an alert is present and, by default, accepts it.
49+
"""Verifies that an alert is present and by default, accepts it.
5050
5151
Fails if no alert is present. If ``text`` is a non-empty string,
5252
then it is used to verify alert's message. The alert is accepted
@@ -57,8 +57,8 @@ def alert_should_be_present(self, text='', action=ACCEPT, timeout=None):
5757
If it is not given, the global default `timeout` is used instead.
5858
5959
``action`` and ``timeout`` arguments are new in SeleniumLibrary 3.0.
60-
In earlier versions the alert was always accepted and timeout was
61-
hard coded to one second.
60+
In earlier versions, the alert was always accepted and a timeout was
61+
hardcoded to one second.
6262
"""
6363
message = self.handle_alert(action, timeout)
6464
if text and text != message:
@@ -70,12 +70,12 @@ def alert_should_not_be_present(self, action=ACCEPT, timeout=0):
7070
"""Verifies that no alert is present.
7171
7272
If the alert actually exists, the ``action`` argument determines
73-
how it should be handled. By default the alert is accepted, but
73+
how it should be handled. By default, the alert is accepted, but
7474
it can be also dismissed or left open the same way as with the
7575
`Handle Alert` keyword.
7676
7777
``timeout`` specifies how long to wait for the alert to appear.
78-
By default the alert is not waited at all, but a custom time can
78+
By default, is not waited for the alert at all, but a custom time can
7979
be given if alert may be delayed. See the `time format` section
8080
for information about the syntax.
8181
@@ -92,7 +92,7 @@ def alert_should_not_be_present(self, action=ACCEPT, timeout=0):
9292
def handle_alert(self, action=ACCEPT, timeout=None):
9393
"""Handles the current alert and returns its message.
9494
95-
By default the alert is accepted, but this can be controlled
95+
By default, the alert is accepted, but this can be controlled
9696
with the ``action`` argument that supports the following
9797
case-insensitive values:
9898

0 commit comments

Comments
 (0)