Skip to content
Closed
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
7 changes: 6 additions & 1 deletion seleniumbase/core/detect_b_ver.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import subprocess
import sys

from seleniumbase.fixtures import shared_utils


class File(object):
def __init__(self, stream):
Expand Down Expand Up @@ -233,7 +235,10 @@ def get_browser_version_from_binary(binary_location):
try:
if binary_location.count(r"\ ") != binary_location.count(" "):
binary_location = binary_location.replace(" ", r"\ ")
cmd_mapping = binary_location + " --version"
if shared_utils.is_windows():
binary_location = f'powershell -command "&{{(Get-Item {binary_location}).VersionInfo.ProductVersion}}"'
else:
cmd_mapping = binary_location + " --version"
pattern = r"\d+\.\d+\.\d+"
quad_pattern = r"\d+\.\d+\.\d+\.\d+"
quad_version = read_version_from_cmd(cmd_mapping, quad_pattern)
Expand Down