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

Failed to Download the Edge driver for particular Version #251

Closed
AnithaSyed opened this issue Oct 19, 2021 · 4 comments · Fixed by #260
Closed

Failed to Download the Edge driver for particular Version #251

AnithaSyed opened this issue Oct 19, 2021 · 4 comments · Fixed by #260
Assignees

Comments

@AnithaSyed
Copy link

AnithaSyed commented Oct 19, 2021

Hi,
I have been facing problems on downloading the chrome driver while using web driver manager and I raised issues before.
Now I switched to use the Edge driver to work and it's working fine while I test in console, but When I try with Jenkins it is unable to download the driver.
Now I manually giving the suitable version as a input to download the driver but still i am seeing the same error.
My Code is:

import os, time
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.microsoft import EdgeChromiumDriverManager
from selenium.webdriver.edge.options import Options
from selenium.webdriver.edge.service import Service

chrome_options = Options()
prefs = {'safebrowsing.enabled': 'false','download.default_directory' : os.getcwd() + os.path.sep}
chrome_options.add_experimental_option("prefs", prefs)
chrome_options.add_experimental_option("useAutomationExtension", False)
chrome_options.add_argument('headless')

driver = webdriver.Edge(service = Service(EdgeChromiumDriverManager(edgevesion()).install()), options = chrome_options)

driver.get (url)

Here edgevesion() will give the browser version as output

I got the error as:

[WDM] - ====== WebDriver manager ======
Traceback (most recent call last):
  File "Edge_cov.py", line 317, in <module>
    driver = webdriver.Edge(service = Service(EdgeChromiumDriverManager(edgevesion()).install()), options = chrome_options)
  File "webdriver_manager\microsoft.py", line 51, in __init__
  File "webdriver_manager\driver.py", line 282, in __init__
  File "webdriver_manager\utils.py", line 159, in get_browser_version_from_os
ValueError: Could not get version for edge with the command: reg query "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Edge\BLBeacon" /v version
[26368] Failed to execute script 'Edge_cov' due to unhandled exception!

Since I gave the version, it has to download it, but it is checking the version again.
Please help me on this What I did wrong

@aleksandr-kotlyar
Copy link
Collaborator

aleksandr-kotlyar commented Oct 20, 2021

@AnithaSyed hello.

I have discovered: thats happen because Chrome drivers for GoogleChrome,Chromium,MSEdge browsers are always checking the installed version to log to console, even if version of webdriver was set manually. And if they can't find installed browser version - they raise ValueError. That's an issue of webdriver_manager. Thank you for report!

I think about making wedriver_manager more stable for users who know which version they need.

I have described how I see it should be: in #254.

@AnithaSyed
Copy link
Author

I see the #260 is mentioned as a resolve for my issue and it is merged too.
But I am still facing the issue. So is it released yet?

@aleksandr-kotlyar
Copy link
Collaborator

@AnithaSyed code is in master branch but 3.5.2 not released yet.

@AnithaSyed
Copy link
Author

AnithaSyed commented Nov 3, 2021

@aleksandr-kotlyar
I updated to 3.5.2 and
I passed the version as '94.0.992.38'

but I am getting below error


File "C:\Users\Anaconda3\lib\site-packages\debugpy\_vendored\pydevd\_pydev_bundle\pydev_umd.py", line 167, in runfile
  execfile(filename, namespace)

File "C:\Users\Anaconda3\lib\site-packages\debugpy\_vendored\pydevd\_pydev_imps\_pydev_execfile.py", line 25, in execfile
  exec(compile(contents + "\n", file, 'exec'), glob, loc)

File "C:/Users/Desktop/Remote_work/EdgeTest/Edge.py", line 45, in <module>
  driver = webdriver.Edge(service = Service(EdgeChromiumDriverManager('94.0').install()), options = chrome_options)

File "C:\Users\Anaconda3\lib\site-packages\webdriver_manager\microsoft.py", line 50, in __init__
  super().__init__(path, log_level, print_first_line, cache_valid_range)

File "C:\Users\Anaconda3\lib\site-packages\webdriver_manager\manager.py", line 13, in __init__
  log("====== WebDriver manager ======", level=log_level)

File "C:\Users\Anaconda3\lib\site-packages\webdriver_manager\logger.py", line 25, in log
  _init_logger(level, name, first_line, formatter)

File "C:\Users\Anaconda3\lib\site-packages\webdriver_manager\logger.py", line 19, in _init_logger
  _logger.setLevel(level)

File "C:\Users\Anaconda3\lib\logging\__init__.py", line 1421, in setLevel
  self.level = _checkLevel(level)

File "C:\Users\Anaconda3\lib\logging\__init__.py", line 201, in _checkLevel
  raise TypeError("Level not an integer or a valid string: %r" % level)

TypeError: Level not an integer or a valid string: None

@aleksandr-kotlyar aleksandr-kotlyar self-assigned this May 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants