Please help me solve this issue:- WebDriverException: The browser appears to have exited before we could connect

0 votes

I am working on my CentOS 6.4 server and I've installed firefox and Xvfb already. But, on running this code, I get an error.

from selenium import webdriver
browser = webdriver.Firefox()

Error

selenium.common.exceptions.WebDriverException: Message: 
'The browser appears to have exited before we could connect. The output was: None'

I read else where that I have to remove all files in tmp folder, for this to work. But, it still doesn't work. any ideas? Thanks in advance!

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__
    self.binary, timeout),
  File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
    self.binary.launch_browser(self.profile)
  File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 64, in launch_browser
    self._wait_until_connectable()
  File "/usr/local/lib/python3.4/site-packages/selenium/webdriver/firefox/firefox_binary.py", line 103, in _wait_until_connectable
    self._get_firefox_output())
selenium.common.exceptions.WebDriverException: Message: 'The browser appears to have exited before we could connect. The output was: None' 
May 14, 2018 in Selenium by eLiJha
• 720 points
324 views

1 answer to this question.

0 votes

If its a Python code, then along with Xvfb, you have to also install pyvirtualdisplay. PS: It worked for me on my Ubuntu server.

sudo apt-get install xvfb
sudo pip install pyvirtualdisplay

After this, my python code executed like a charm.

#!/usr/bin/env python

from pyvirtualdisplay import Display
from selenium import webdriver

display = Display(visible=0, size=(1024, 768))
display.start()

browser = webdriver.Firefox()
browser.get('http://www.ubuntu.com/')
print browser.page_source

browser.close()
display.stop()
answered May 14, 2018 by king_kenny
• 3,650 points

Related Questions In Selenium

0 votes
2 answers

Stuck in this issue please help me out

NoClassDefFoundError exception : Mismatch of classpath in ...READ MORE

answered Sep 6 in Selenium by varun
• 140 points
55 views
+1 vote
0 answers
0 votes
1 answer

Help me with the steps to write first Selenium C# test case.

Hey Wareena, you can use following steps ...READ MORE

answered Jun 10 in Selenium by Anvi
• 12,860 points
51 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,090 points
589 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
899 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
575 views
0 votes
1 answer
0 votes
1 answer

How to open a browser windows silently in the background?

It is a little bit of a ...READ MORE

answered Apr 20, 2018 in Selenium by king_kenny
• 3,650 points
175 views