Skip to content

Commit

Permalink
Merge pull request #655 from catchpoint/firefox_fix
Browse files Browse the repository at this point in the history
Fix selenium version
  • Loading branch information
claud-io authored Apr 18, 2024
2 parents 2fce1dd + f3a29e4 commit 330cc0a
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit 330cc0a

Please sign in to comment.