0
from selenium import webdriver
from selenium.webdriver.common.keys import Keys

driver = webdriver.Firefox()
#driver.set_preference("browser.startup.homepage_override.mstone", "ignore")
driver.get("https://url.aspx/")
username = driver.find_element_by_name("SchSel$txtUserName")
username.clear()
username.send_keys("username")
username.send_keys(Keys.RETURN)
password = driver.find_element_by_name("SchSel$txtPassword")
password.clear()
password.send_keys("pass")
password.send_keys(Keys.RETURN)
driver.get("https://.aspx")
assert "Welcome" in driver.page_source
driver.close()

I am running selenium for the first time .How many times I try blank page opens in fireFox

selenium.common.exceptions.WebDriverException: Message: The browser appears to have exited before we could connect. If you specified a log_file in the FirefoxBinary constructor, check it for details.

kragor
  • 105
  • 2
  • 11

1 Answers1

0

I think I had a similar problem and used the info at this link to help:

https://stackoverflow.com/a/30103931/6582364

Basically it suggests using xvfb and pyvirtualdisplay which wraps the firefox browser. Link also contains sample code. Doesn't take too long to install and get running but worked for me.

Hope this works for you too.

Community
  • 1
  • 1
Mike77
  • 363
  • 1
  • 2
  • 11
  • how to install xvfb in windows – kragor Aug 11 '16 at 05:40
  • Hmm, good question - I've not done it in Windows but this link here suggests using MS SysInternals package, but I've not tried this before... https://gist.github.com/addyosmani/5336747 https://technet.microsoft.com/en-us/sysinternals/cc817881.aspx – Mike77 Aug 11 '16 at 05:44
  • I also found this on another stackoverflow article about how one guy built his own workaround: http://stackoverflow.com/a/969837/6582364 – Mike77 Aug 11 '16 at 05:47