Not identifying drivers when drivers and configured in environment variables. | Selenium Python Forum
20% Off Lockdown Learning Discount Avail Now

Not identifying drivers when drivers and configured in environment variables.

M
Mohan Post on 22/04/2020

Question #1:  When drivers are configured at environment variables system is not identifying drivers and throwing console errors.  Error details are attached.

browserName="Chrome"

webdriver.driver = None

if(browserName=="Chrome"):
driver = webdriver.Chrome()

elif(browserName=="Firefox"):
driver = webdriver.Firefox(

elif(browserName=="Edge"):
driver = webdriver.Edge()

elif(browserName=="ie"):
driver=webdriver.Ie()

else:
print("No browser is specified")

driver.get("https://www.facebook.com/")
driver.implicitly_wait(5)

fbLogo=driver.find_element_by_xpath("//div[@id='blueBarDOMInspector']/div/div/div/div/h1/a").text
print(fbLogo)
driver.close()

S

Instructor

Sejal Reply on 23/04/2020

Hey, Please make sure that the driver classes whih is extracted are not edited nor even the name.

After adding the driver classes in the environment variable, restart the system. 

Then in eclipse, before running the test case just follow the path : project(in the tab)<clean <clean all projects and simply restart eclipse.

Then try to run the code.

Related Post