Skip to content

Commit

Permalink
fix for conda install of selenium-manager (#12536)
Browse files Browse the repository at this point in the history
* fix for conda install of selenium-manager

conda doesn't seem to properly package selenium-manager, so it needs
to be install as a separate package (via conda). But this puts it in
the environment's bin folder.

This commit checks the path for the selenium-manager executable if
it isn't installed in the package's webdriver/common/<platform>/
folder.

fixes #11234 and #12084

* fix linting error

* use conda bin folder, rather than searching PATH

* fix for tox/linting error
  • Loading branch information
stevetracvc authored Aug 15, 2023
1 parent 5e42f66 commit d4285d1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions py/selenium/webdriver/common/selenium_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# under the License.
import json
import logging
import os
import subprocess
import sys
from pathlib import Path
Expand Down Expand Up @@ -53,6 +54,10 @@ def get_binary() -> Path:

path = Path(__file__).parent.joinpath(directory, file)

if not path.is_file() and os.environ["CONDA_PREFIX"]:
# conda has a separate package selenium-manager, installs in bin
path = Path(os.path.join(os.environ["CONDA_PREFIX"], "bin", file))
logger.debug(f"Conda environment detected, using `{path}`")
if not path.is_file():
raise WebDriverException(f"Unable to obtain working Selenium Manager binary; {path}")

Expand Down

0 comments on commit d4285d1

Please sign in to comment.