Skip to content

Adding w3c Chromedriver support #352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions seleniumbase/console_scripts/sb_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ def main():
inner_folder = None

if name == "chromedriver":
latest_version = "2.46"
latest_version = "2.44" # It's not the latest, but most compatible
if "darwin" in sys_plat:
file_name = "chromedriver_mac64.zip"
elif "linux" in sys_plat:
latest_version = "2.40" # Linux machines may need the old driver
latest_version = "2.44" # Linux machines may need the old driver
file_name = "chromedriver_linux64.zip"
elif "win32" in sys_plat or "win64" in sys_plat or "x64" in sys_plat:
file_name = "chromedriver_win32.zip" # Works for win32 / win_x64
Expand Down
1 change: 1 addition & 0 deletions seleniumbase/core/browser_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ def _set_chrome_options(
}
}
chrome_options.add_experimental_option("prefs", prefs)
chrome_options.add_experimental_option("w3c", True)
if enable_sync:
chrome_options.add_experimental_option(
"excludeSwitches", ["disable-sync"])
Expand Down
14 changes: 12 additions & 2 deletions seleniumbase/fixtures/js_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,12 @@ def highlight_with_jquery_2(driver, message, selector, o_bs, msg_dur):


def scroll_to_element(driver, element):
element_location = element.location['y']
element_location = None
try:
element_location = element.location['y']
except Exception:
element.location_once_scrolled_into_view
return
element_location = element_location - 130
if element_location < 0:
element_location = 0
Expand All @@ -611,7 +616,12 @@ def slow_scroll_to_element(driver, element, browser):
scroll_to_element(driver, element)
return
scroll_position = driver.execute_script("return window.scrollY;")
element_location = element.location['y']
element_location = None
try:
element_location = element.location['y']
except Exception:
element.location_once_scrolled_into_view
return
element_location = element_location - 130
if element_location < 0:
element_location = 0
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name='seleniumbase',
version='1.26.3',
version='1.26.4',
description='Fast, Easy, and Reliable Browser Automation & Testing.',
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down