Releases: seleniumbase/SeleniumBase
Use "options" instead of "desired_capabilities" as needed
Use "options" instead of "desired_capabilities" as needed
desired_capabilities
are deprecated in Selenium 4, so they are converted tooptions
instead.
-- (This only effects Python versions 3.7 and newer. Python 3.6 and below still use Selenium 3.)- Also speed up messages in Headless Mode.
- Also refresh Python dependencies:
--setuptools>=59.1.1;python_version>="3.6"
--jedi==0.18.1;python_version>="3.6"
--filelock==3.4.0;python_version>="3.6"
--rich==10.14.0;python_version>="3.6"
Refresh the "setuptools" dependency
Refresh the "setuptools" dependency
setuptools>=59.0.1;python_version>="3.6"
- Resolves #1073
Improve arg-parsing for Selenium Grid usage
Improve arg-parsing for Selenium Grid usage
This change improves how the command-line args are used to construct the server address for connecting to a Selenium Grid. If the port is included in the --server
arg, then that will be used instead of adding on the port via --port
. Additionally, if the port is specified separately with --port
(as it was previously), then the port will now get added to the correct location in the server address string if the server URL included multiple slashes.
(See https://seleniumbase.io/seleniumbase/utilities/selenium_grid/ReadMe/ for the complete Selenium Grid usage instructions.)
Make improvements to the "Deferred Assert" system
Make improvements to the "Deferred Assert" system
SeleniumBase deferred asserts allow you to make multiple assertions on the same page without failing the test after the first failed assert. Instead, you can choose when to process those assertions by calling: self.process_deferred_asserts()
.
- Add
self.deferred_assert_exact_text()
-- (This is similar toself.deferred_assert_text()
, but text must beequal
, instead ofin
.) - Fix spacing in the console output of deferred assertion failures.
- This resolves #1065
- Example test: SeleniumBase/examples/test_deferred_asserts.py
Also refresh Python dependencies:
traitlets
version now only has a lower bound, instead of an exact version.
-- (For Python versions 3.7 and newer. Earlier Python versions still use a pin.)
traitlets==4.3.3;python_version<"3.7"
traitlets>=5.1.1;python_version>="3.7"
Update Recorder Mode script-generation, and more
Update Recorder Mode script-generation, and more
This is to prevent a duplicate browser action that can occur when a click redirects to a new URL. The Recorder will record a click()
and an open()
action, but if the click already takes the user to the URL being opened, then the browser does not need to call the open()
action separately, and instead should mask the action with open_if_not_url()
. This issue was discovered when clicking a link with href="https://en.wikipedia.org/"
, which redirected to https://en.wikipedia.org/wiki/Main_Page
.
Other changes include:
- Better error-handling for the
open()
method. - Update timing logic for the time-limit feature.
- Refresh Python dependencies:
--more-itertools==8.11.0;python_version>="3.5"
Simplify output associated with "NoSuchWindowException"
Simplify output associated with "NoSuchWindowException"
This is for #1060
Although this won't handle all cases of the above, improvements will be noticeable in many situations.
Also refresh Python dependencies:
- pycparser==2.21
- rich==10.13.0;python_version>="3.6"
Multiple improvements to the Recorder and Recorder Mode
Windows and EdgeDriver updates
Windows and EdgeDriver updates
- Add better detection for the version of Edge installed.
- Disable
Edge Sync
if not set. - Use
LATEST_STABLE
for the default version of EdgeDriver. - Add ability to install EdgeDriver without knowing full version.
- Use
os.get_terminal_size()
instead ofstty size
for width. - On Windows, use
abap
overmonokai
for the print theme. - Refresh Python dependencies:
--setuptools>=58.5.2;python_version>="3.6"
--soupsieve==2.3;python_version>="3.6"
This resolves:
Updates to Recorder Mode and Multi-Factor Auth methods
Updates to Recorder Mode and Multi-Factor Auth methods
- Add
self.save_recorded_actions()
"""(When using Recorder Mode, use this method if you plan on
navigating to a different domain/origin in the same tab.)
This method saves recorded actions from the active tab so that
a complete recording can be exported as a SeleniumBase file at the
end of the test. This is only needed in special cases because most
actions that result in a new origin, (such as clicking on a link),
should automatically open a new tab while Recorder Mode is enabled."""
- Add
self.enter_mfa_code(selector, totp_key)
:
"""Enters into the field a Multi-Factor Authentication TOTP Code.
If the "totp_key" is not specified, this method defaults
to using the one provided in [seleniumbase/config/settings.py].
The TOTP code is generated by the Google Authenticator Algorithm.
This method will automatically press ENTER after typing the code."""
-
Improve Recorder Mode event-processing.
-
Refactor MFA methods:
self.get_mfa_code(totp_key=None)
# Duplicates: self.get_totp_code(totp_key=None)
# self.get_google_auth_password(totp_key=None)
# self.get_google_auth_code(totp_key=None)
self.enter_mfa_code(selector, totp_key=None, by=By.CSS_SELECTOR, timeout=None)
# Duplicates: self.enter_totp_code(selector, totp_key=None, by=By.CSS_SELECTOR, timeout=None)
- Refresh Python dependencies:
--setuptools>=58.4.0;python_version>="3.6"
--virtualenv>=20.10.0
Here's a longer description of why self.save_recorded_actions()
might be needed in some special cases:
🔴 Recorder Mode works by saving your recorded actions into the browser's sessionStorage
. SeleniumBase then reads from the browser's sessionStorage
to take the raw data and generate a full test from it. Keep in mind that sessionStorage
is only present for a website while the browser tab remains on a web page of the same domain/origin. If you leave that domain/origin, the sessionStorage
of that tab will no longer have the raw data that SeleniumBase needs to create a full recording. To compensate for this, all links to web pages of a different domain/origin will automatically open a new tab for you while in Recorder Mode. Additionally, the SeleniumBase self.open(URL)
method will also open a new tab for you in Recorder Mode if the domain/origin is different from the current URL. If you need to navigate to a different domain/origin from within the same tab, call self.save_recorded_actions()
first, which saves the recorded data for later. When the recorded test completes, SeleniumBase will scan the sessionStorage
of all open browser tabs for the data it needs to generate the complete SeleniumBase automation script.
Several updates to various areas
Several updates to various areas
- Recorder: Add the ability to create asserts without full clicks.
- Recorder: Add
--gui
option to thesbase mkrec
command:
-- Necessary because the default mode is headless on Linux. - Set the default website tour library theme to be "IntroJS".
- Add "tab" methods that work the same as "window" methods.
- Add "self.get_totp_code()" (shorter version of Google Auth).
- Add an example test for Multi-Factor Auth Login.
- Add shortcuts for disable-csp and save-screenshot.
- Refresh Python dependencies:
--packaging>=21.2;python_version>="3.6"
--filelock==3.3.2;python_version>="3.6"
--ipython==7.29.0;python_version>="3.7"