1

I'm using Selenium 3.5 for Python to test some behaviors of my web app using both local pages and online ones. Until now, I just used Chrome as main browser to test it and everything works fine. Then, I decided to use Firefox 55.0.3 using geckodriver v0.19.0. I have the following issues:

  1. selenium opens the local pages such as file:///PATH/index.html but it doesn't close the browser even using the function quit();
  2. I would use some browser option such as the incognito mode, but I was not able to find a list of all available options for Firefox.

This is a snippet of my code to use selenium with Firefox.

from selenium import webdriver

url = 'http://www.yahoo.com'
#url = 'file:///PATH/index.html'

browser = webdriver.Firefox()
browser.get(url)
browser.quit() 
# borser.close() -> I also tried with the close() 

I also read this question for the first issue but it doesn't work with the current version of the used framework. About the second I can only find partial solution such as this one for the incognito mode but it doesn't work as expected.

Any ideas? Is it a kind of bug in geckodriver?

antedesk
  • 756
  • 6
  • 15
  • 30
  • It could be a bug but as a workaround you could just go to a `browser.get("about:blank")` and then try quit – Tarun Lalwani Sep 22 '17 at 17:36
  • Hey @TarunLalwani, your solution works fine when i open a real URL like the first one in the example code. Unfortunately, I tried with the local webpage (the second URL in the example) and it doesn't work. The browser stalls on the local page without opening the blank one. – antedesk Sep 25 '17 at 09:48
  • Open an issue with geckodriver repo and see they have some insights – Tarun Lalwani Sep 25 '17 at 09:50

0 Answers0