Not Able to open Edge browser directly after adding the edge driver to the system variables | Selenium Python Forum
Anand komiripalem Posted on 09/10/2020

After adding the edge driver to system variables. if i'm trying to launch the edge browser it is giving the following error. but the same is working fine if i give the path in driver object. can any one suggest what i should do to directly open the edge browser.




Traceback (most recent call last):
File "C:\Users\Devdas\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\", line 72, in start
self.process = subprocess.Popen(cmd, env=self.env,
File "C:\Users\Devdas\AppData\Local\Programs\Python\Python38-32\lib\", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\Devdas\AppData\Local\Programs\Python\Python38-32\lib\", line 1307, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Devdas\eclipse-workspace\demo\", line 4, in <module>
driver = webdriver.Edge()
File "C:\Users\Devdas\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\edge\", line 56, in __init__
File "C:\Users\Devdas\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\", line 81, in start
raise WebDriverException(
selenium.common.exceptions.WebDriverException: Message: 'MicrosoftWebDriver.exe' executable needs to be in PATH. Please download from


09914040666 Replied on 09/10/2020


The error clearly shows what the issue is "FileNotFoundError: [WinError 2] The system cannot find the file specified". After adding the driver into system variable, system needs to be restarted for the changes to be applied. 

The way is to restart the system after adding driver to system variables and after restart try running your script.

Anand komiripalem Replied on 10/10/2020

Hi Jaspreet, 


I have done restart after adding the system variables. it is working fine with the firefox and chrome, but with edge i'm the facing the same error every time i try to access the browser through the program. 

09914040666 Replied on 10/10/2020


Kindly attach the code so that i can check.

Anand komiripalem Replied on 10/10/2020

in the below program if im removing the path of edge, it is giving me the error.


from selenium import webdriver

browsername = input("Enter the Browser to Execute the code: ")

browser = browsername.lower()

if browser == 'chrome':
       driver = webdriver.Chrome()

elif browser == 'firefox':
       driver = webdriver.Firefox()

elif browser == 'edge':
       path = "C:\\edgedriver\\msedgedriver.exe"
       driver = webdriver.Edge(executable_path=path)
      print("browser not supported")

   if browser != None:
   print("Sorry cannot go further")

09914040666 Replied on 10/10/2020


If driver of Edge is named with this "msedgedriver.exe", then please rename it to "MicrosoftWebDriver.exe" and then try to run without passing the path in arguments.

Related Posts