selenium.common.exceptions.WebDriverException: Message: quit in Selenium Python -
i trying run automation script based on selenium using python.
i getting below error when trying run script.there seems issue driver.quit(), although driver.quit works in internet explorer erroring out in firefox. have searched error not many results came creating question. below script seems work @ times fails. error message not give idea why occuring, appreciate if me out.
system details:
python version = 3.6.2 firefox version = 53 32-bit selenium = 3.4.3 geckodriver = 0.18.0 32-bit
code block:
os.environ['path']=r'p:\imran-tems\selenium-3.4.3' user_id=getpass.getuser() location = "c:\\users\\" + user_id + "\\appdata\\local\\mozilla firefox\\firefox.exe" binary = firefoxbinary(location) profile = webdriver.firefoxprofile() profile.set_preference('network.proxy.type', 1) profile.set_preference('network.proxy',"proxy1") profile.set_preference('network.proxy.ftp',"proxy1") profile.set_preference('network.proxy.ssl',"proxy1") profile.set_preference('network.proxy.socks',"proxy1") profile.set_preference('network.proxy.http_port',8080) profile.set_preference('network.proxy.ftp_port',8080) profile.set_preference('network.proxy.ssl_port',8080) profile.set_preference('network.proxy.socks_port',8080) profile.update_preferences() driver = webdriver.firefox(firefox_profile=profile,firefox_binary=binary) driver.get(link) # have not mentioned link due client privacy link1= webdriverwait(driver, 10).until(ec.presence_of_element_located((by.id, "access-number"))) link1.click() link1.send_keys('14188768') link1= webdriverwait(driver, 10).until(ec.presence_of_element_located((by.id,'securitynumber'))) link1.click() link1.send_keys('2468') link1= webdriverwait(driver, 10).until(ec.presence_of_element_located((by.id,'internet-password'))) link1.click() link1.send_keys('test12') sleep(1) link1.send_keys(keys.return) sleep(2) link2=webdriverwait(driver, 10).until(ec.presence_of_element_located((by.xpath,"id('header')/div[1]/p[1]/a[1]/span[1]"))) link2.click() driver.quit()
error stack trace:
traceback (most recent call last): file "p:\imran-tems\script\test.py", line 54, in <module> driver.quit() file "c:\users\l096535\appdata\local\programs\python\python36-32\lib\site-packages\selenium-3.4.3-py3.6.egg\selenium\webdriver\firefox\webdriver.py", line 181, in quit remotewebdriver.quit(self) file "c:\users\l096535\appdata\local\programs\python\python36-32\lib\site-packages\selenium-3.4.3-py3.6.egg\selenium\webdriver\remote\webdriver.py", line 551, in quit self.execute(command.quit) file "c:\users\l096535\appdata\local\programs\python\python36-32\lib\site-packages\selenium-3.4.3-py3.6.egg\selenium\webdriver\remote\webdriver.py", line 256, in execute self.error_handler.check_response(response) file "c:\users\l096535\appdata\local\programs\python\python36-32\lib\site-packages\selenium-3.4.3-py3.6.egg\selenium\webdriver\remote\errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.webdriverexception: message: quit
i think updating browser latest version might you, not sure though.
Comments
Post a Comment