Changelogs » Seleniumbase

Seleniumbase

1.21.9

Add a command-line option to disable the Content Security Policy.
(The CSP may prevent SeleniumBase custom JavaScript abilities from loading on various web pages.)

1.21.8

Fix browser extension loading for PyPI installations:
* Include browser extensions as part of PyPI package data

1.21.7

* Update ad-blocker rules

1.21.6

Disable the Content Security Policy of websites by default (on Chrome and Firefox)
(If running tests on headless Chrome, the existing Content Security Policy will remain.)

1.21.5

Add methods for setting and removing element attributes:
* Add ``self.set_attribute(selector, attribute, value)``
* Add ``self.remove_attribute(selector, attribute)``

1.21.4

* Save exported website tours to the "tours_exported" folder
* Update tour examples
* Set flake8 version to 3.7.7

1.21.3

Add a command-line option to archive old log files rather than deleting them.

If the option is set, log files from the latest_logs folder will get moved to the archived_logs folder for storage. Otherwise, any existing logs in the latest_logs folder will be deleted at the start of the next test run.

Usage: (on the command line when running tests)
* ``--archive_logs``

1.21.2

Add the ability to save screenshots at the end of tests.
This adds the feature for passing tests. (This feature already existed for failing tests automatically.)
Check the latest_logs folder for the images.

Usage: (on the command line when running tests)
* ``--save_screenshot``

The screenshot will be taken right before the browser is closed.

1.21.1

Add "limit" argument to methods that return or click multiple elements.
Updated methods:  ("0" means no limit)
* ``self.find_elements(selector, by=By.CSS_SELECTOR, limit=0)``
* ``self.find_visible_elements(selector, by=By.CSS_SELECTOR, limit=0)``
* ``self.click_visible_elements(selector, by=By.CSS_SELECTOR, limit=0)``

Example:
``self.click_visible_elements('[type="checkbox"]', limit=5)``
(Click the first 5 visible checkboxes on a page)

1.21.0

Add the ability to set the User-Agent for the browser:
* Usage: ``--agent="USER-AGENT STRING"``

Example:

pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7412.EU"


Other changes:
* Fix the Docker integration
* Update console scripts for page-object manipulation
* Update several ReadMe files

1.20.0

New console scripts for manipulating page objects:

"seleniumbase" ...

+ "extract-objects"

Usage:
seleniumbase extract-objects [SELENIUMBASE_PYTHON_FILE]
Output:
Creates page objects based on selectors found in a
seleniumbase Python file and saves those objects to the
"page_objects.py" file in the same folder as the tests.

+ "inject-objects"

Usage:
seleniumbase inject-objects [SELENIUMBASE_PYTHON_FILE]
Options:
-c, --comments  (Add object selectors to the comments.)
(Default: No added comments.)
Output:
Takes the page objects found in the "page_objects.py"
file and uses those to replace matching selectors in
the selected seleniumbase Python file.

+ "objectify"

Usage:
seleniumbase objectify [SELENIUMBASE_PYTHON_FILE]
Options:
-c, --comments  (Add object selectors to the comments.)
(Default: No added comments.)
Output:
A modified version of the file where the selectors
have been replaced with variable names defined in
"page_objects.py", supporting the Page Object Pattern.

(seleniumbase "objectify" has the same outcome as
combining "extract-objects" with "inject-objects")

+ "revert-objects"

Usage:
seleniumbase revert-objects [SELENIUMBASE_PYTHON_FILE]
Options:
-c, --comments  (Keep existing comments for the lines.)
(Default: No comments are kept.)
Output:
Reverts the changes made by "seleniumbase objectify" or
"seleniumbase inject-objects" when run against a
seleniumbase Python file. Objects will get replaced by
selectors stored in the "page_objects.py" file.

1.19.9

Update webdriver installation script:
* ``seleniumbase install chromedriver`` will now install chromedriver v2.46, except on Linux machines, which may be using older versions of Chrome
* ``seleniumbase install geckodriver`` will now install v0.24.0 (for Firefox)
* ``seleniumbase install operadriver`` will now install v.2.40

Other changes:
* Update starting browser dimensions

1.19.8

Update requirements:
* Update pytest to v4.3.0

1.19.7

Clone an existing method with an additional name:
* Add ``self.assert_element_visible(CSS_SELECTOR)``, which does the same thing as ``self.assert_element(CSS_SELECTOR)``.

1.19.6

Adding exact text methods and other improvements:
* Add ``self.assert_exact_text()``
* Add ``self.wait_for_exact_text_visible()``
* Update pytest version to 4.2.1
* Adding more reliability to some methods
* Fix a bug with text assertion

1.19.5

Fix Python 2 compatibility:
* Use more-itertools version >=5.0.0,<6.0.0

1.19.4

Update parameterized version:
*  Set ``parameterized>=0.7.0``

1.19.3

Mostly updating example tests to use a non-camelCase format for assertions.
* ``self.assert_true()`` can now be used in place of ``self.assertTrue()``
* ``self.assert_equal()`` can now be used in place of ``self.assertEqual()``

1.19.2

Tour update:
* Save the URL with exported SeleniumBase JavaScript tours

1.19.1

Refactoring and new methods:
* Git-ignore the .vscode folder
* flake8 upgraded to v3.7.4
* Simplify BeautifulSoup usage
* Remove old deprecated methods
* Deprecate scroll_click() because click() already scrolls
* Add methods to avoid using camelCase in Python

1.19.0

Update pytest requirements and a few other things:
* Updated requirements: ``pytest>=4.2.0``, ``pytest-xdist>=1.26.1``, ``flake8==3.7.3``.
* Add option to raise a Python Exception immediately when specifying an invalid proxy string, rather than waiting to display a warning message at the end of the test run (without using a proxy server). Usage: ``--proxy=[PROXY_STRING]``.
* Disable Chrome local_discovery pop-up notifications, such as "New printer on your network".

1.18.2

Update "parameterized" version:
* Use parameterized==0.6.3

1.18.1

Mostly replacing deprecated pytest code with new code to prevent:
``PytestDeprecationWarning: the `pytest.config` global is deprecated.  Please use `request.config` or `pytest_configure` (if you're a pytest plugin) instead.``

The solution involved using ``sb_config`` in place of ``pytest.config.option``

Unrelated, there's also a small update to fix a console script used for downloading the selenium server jar file. (It's only needed when you're trying to run your own Selenium Grid)

1.18.0

Improve Messenger methods and a few other things
* Improve methods for posting in-test messages with JS
* Update pytest-html to >= 1.20.0
* Add an example that can be run without the Pytest unittest runner (AKA pure Python)

1.17.22

Update pytest requirements:

* pytest>=4.1.1
* pytest-rerunfailures>=6.0
* pytest-xdist>=1.26.0

1.17.21

Update console scripts and traffic-generation code
* Autodetect "source" for activating virtualenv commands in bash
* Update seleniumbase console scripts menu
* Update traffic-generation code

1.17.20

Allow a custom timeout for wait_for_link_text_present()
Allow a custom timeout for wait_for_link_text_visible()

1.17.19

Update dependencies:
* pytest>=4.1.0
* pytest-cov>=2.6.1
* requests==2.20.1

1.17.18

* Update the Selenium IDE conversion tool
* Also update a method for clicking link text inside of dropdown menus

1.17.17

Update virtualenv script and manifest file:
* Fix echo commands in a virtualenv Windows batch file
* Update the manifest file