Video #2 - When variable borwserName is assigned with ie with below code, system is just opening an empty Internet Explorer but not accessing given URL: | Selenium Python Forum
M
Mohan Posted on 22/04/2020

Video #2 - When variable borwserName is assigned with "ie" with below code, system is just opening an empty Internet Explorer but not accessing given URL. Please see below code.

browserName="ie"

webdriver.driver = None

if(browserName=="Chrome"):
path="E:/Drivers/chromedriver.exe"
driver = webdriver.Chrome(executable_path=path)

elif(browserName=="Firefox"):
path="E:/Drivers/geckodriver.exe"
driver = webdriver.Firefox(executable_path=path)

elif(browserName=="Edge"):
path="E:/Drivers/msedgedriver.exe"
driver = webdriver.Edge(executable_path=path)

elif(browserName=="ie"):
path="E:/Drivers/IEDriverServer.exe"
driver=webdriver.Ie(executable_path=path)

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()


0
09914040666 Replied on 23/04/2020

Hey, there is no issue in the code. 

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 Posts