You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If use current version webdriver_manager 2.3.0 with Apline linux distributions - it can't find chrome browser in path, because there is no google-chrome distib at alpine repository.
_____________________________ test_chrome_version ______________________________src/test/test_wdm.py:16: in test_chrome_version logging.info(utils.chrome_version())/usr/local/lib/python3.7/site-packages/webdriver_manager/utils.py:98: in chrome_version .format(cmd)E ValueError: Could not get version for Chrome with this command: google-chrome --version
Add second try to execute cmd='chromium --version' if os_name() == OSType.LINUX:
# webdriver_manager/utils.pydefchrome_version():
pattern=r'\d+\.\d+\.\d+'cmd_mapping= {
OSType.LINUX: 'google-chrome --version',
OSType.MAC: r'/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version',
OSType.WIN: r'reg query "HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon" /v version'
}
cmd=cmd_mapping[os_name()]
stdout=os.popen(cmd).read()
version=re.search(pattern, stdout)
ifnotversion:
ifos_name() ==OSType.LINUX:
cmd='chromium-browser --version'try:
stdout=os.popen(cmd).read()
version=re.search(pattern, stdout)
assertversionreturnversion.group(0)
exceptAssertionError:
raiseValueError('Could not get version for Chrome with this command: {}'.format(cmd))
raiseValueError('Could not get version for Chrome with this command: {}'.format(cmd))
returnversion.group(0)
I can make a PR, but want to discuss first, which solution is better. @SergeyPirogov what do you think, which solution is better? Or maybe we should wait if someone can suggest the best one?
The text was updated successfully, but these errors were encountered:
Problem
If use current version
webdriver_manager 2.3.0
withApline linux
distributions - it can't find chrome browser in path, because there is nogoogle-chrome
distib atalpine
repository.Here is the code:
Here is the stacktrace:
Here is Dockerfile python:3.7-alpine + chrome:3.11-alpine
Solution
I think we need to add checker if linux uses chromium or google-chrome browser.
I suggest two vartiants:
First
That we can add check if OS.ID is Alpine, we can try to extract id of distribution like here, but python-like:
Second
Add second try to execute
cmd='chromium --version'
ifos_name() == OSType.LINUX
:I can make a PR, but want to discuss first, which solution is better.
@SergeyPirogov what do you think, which solution is better? Or maybe we should wait if someone can suggest the best one?
The text was updated successfully, but these errors were encountered: