Skip to content
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

Revert "Revert "Fix selenium version"" #661

Merged
merged 1 commit into from
Apr 18, 2024
Merged
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
16 changes: 16 additions & 0 deletions wptagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,19 @@ def get_browser_versions(browsers):
browsers[browser]['version'] = get_file_version(exe)


def fix_selenium_version():
"""
On older python versions we are going to force selenium version 3.141.0,
newer versions are going to use 4.8.3
"""
from internal.os_util import run_elevated
version = '4.8.3'
if sys.version_info[1] == 6:
version = '3.141.0'

run_elevated(sys.executable, f'-m pip install selenium=={version}')


# Constant used for --logformat command line parameter mapping
LOG_FORMATS = ["syslog"]

Expand Down Expand Up @@ -1269,6 +1282,9 @@ def main():
logging.critical("Requires python 2.7")
exit(1)

# Make sure we are using a compatible selenium version
fix_selenium_version()

if options.list:
from internal.ios_device import iOSDevice
ios = iOSDevice()
Expand Down
Loading