Selene

Latest version: v1.0.2

Safety actively analyzes 685670 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 16

2.0.0rc5

drag & drop in advanced commands

when Selenium can interact with simple draggable controls:
* `browser.element('volume-slider-thumb').perform(command.drag_and_drop_to(browser.element('volume-up')))`
* when for some reason, for example because of not loaded page yet, you have to retry dragging until we can asset that element actually was moved to the new location:
* `browser.element('volume-slider-thumb').perform(command.drag_and_drop_to(browser.element('volume-up'), _assert_location_changed=True))`
the `_assert_location_changed=True` is marked as experimental by `_` prefix,
so it may be renamed or removed in future releases.
* `browser.element('volume-slider-thumb').perform(command.drag_and_drop_by_offset(x=-10, y=0))`

when Selenium can not interact with simple draggable controls:
* `browser.element('volume-slider-thumb').perform(command.js.drag_and_drop_to(browser.element('volume-up')))`

when there is no input element with type file, and you need to simulate the "drop file" by JS:
* `browser.element('drag-file-here-to-upload').perform(command.js.drop_file('/path/to/file'))`

Find more examples at these tests:
* element__perform__drag_and_drop_by_offset_test.py
* element__perform__drag_and_drop_to_test.py
* element__perform__drop_file_test.py
* element__perform__js__drag_and_drop_to_test.py

2.0.0rc4

Unfreeze version of typing-extensions to >=4.6.1 to support pydantic v2.0

2.0.0rc3post3

Improves patch to find chromedrivers also for macs with intel processors.

2.0.0rc3post2

Prepare Selene to work with wdm > 3.8.6

Hence, 4.0.0 should be kind of supported now... But Selene's tests, if executed on macOS arm64 – are very unstable with chromedriver downloaded by wdm 4.0.0 :(. That's why we still freeze wdm to 3.8.6, but on your own risk you can try 4.0.0.

2.0.0rc3post1

Fixes patch from rc3 to download latest chromedriver if google did not publish matched chromedriver for latest Chrome version.

webdriver-manager is still frozen to 3.8.6, though there are already 4.0.

Reminder for MacOS users

Remember that on MacOS you probably have either to install Chrome for Testing or specify browser location manually via:

python
from selene import browser
from selenium import webdriver

browser.config.driver_options = webdriver.ChromeOptions()
browser.config.driver_options.binary_location = (
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
)
browser.open('https://www.ecosia.org/')



See more in [2.0.0rc3](https://github.com/yashaka/selene/releases/tag/2.0.0rc3) release notes.

2.0.0rc3

HOTFIX webdriver_manager after changes in google chromedrivers APIs

This hotfix is really hot, so might break something. Use it on your own risk.
If something went wrong, roll back to 2.0.0rc2.

We also froze webdriver_manager version to 3.8.6, so it will not be updated automatically and our hotfix will not be broken :D. Let's see how it goes further... One day we hope to remove hotfix and unfreeze webdriver_manager version.

Should work for new versions of Chrome from v115 out of the box.

If you use webdriver_manager on your own, you can do the following trick to patch it with the fix:

python
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.core.utils import ChromeType

from selene import support

chrome_driver = webdriver.Chrome(
service=Service(
support._extensions.webdriver_manager.patch._to_find_chromedrivers_from_115(
ChromeDriverManager(chrome_type=ChromeType.GOOGLE)
).install()
)
)


Notice underscore prefixes in module and patch function names at `_extensions.webdriver_manager.patch._to_find_chromedrivers_from_115`. Use it on your own risk, as it is marked as private and experimental;).

Remember that currently on macOS the fix itself might not be enough, for Chrome versions less than 117, you probably will have to install [Chrome for Testing](https://github.com/GoogleChromeLabs/chrome-for-testing#what-is-chrome-for-testing) browser instead of Chrome and fix it with `xattr -cr 'Google Chrome for Testing.app'` command. An alternative to installing Chrome for Testing, can be setting binary location manually via:

python
from selene import browser
from selenium import webdriver

browser.config.driver_options = webdriver.ChromeOptions()
browser.config.driver_options.binary_location = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'

Page 2 of 16

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.