Selenium WebDriver Firefox error - Failed to connect

Dev-Ria

I have done my research and found other related issues. None have helped.

so far:

  • have the up to date version of selenium

  • installed older version of firefox

I have eclipse on windows 7, I created a .war and tested in eclipse under localhost:8080/JSPprojectServlets (on W7) and it works fine. selenium opens firefox, gets url, then gets source.

I then put .war file into my linux (ubuntu) machine under tomcat7/webapps and try to visit it with my windows 7 machine under 192.168.1.102:8080/JSPprojectServlets but it does not work and it gives the following error:

HTTP Status 500 - Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:

type Exception report

message Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows:

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(/usr/bin/firefox) on port 7055; process output follows: 

(process:32704): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Error: no display specified

(process:32711): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Error: no display specified

Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:23:22'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.8.0-29-generic', java.version: '1.7.0_25'
Driver info: driver.version: FirefoxDriver
    org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118)
    org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:244)
    org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:183)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:179)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)
    org.blah.blah.XmlServlet.doGet(XmlServlet.java:25)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
root cause

org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:

(process:32704): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Error: no display specified

(process:32711): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
Error: no display specified

    org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:106)
    org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:244)
    org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:190)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:183)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:179)
    org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)
    org.blah.blah.XmlServlet.doGet(XmlServlet.java:25)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.35 logs.

my code looks like this

package org.blah.blah;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.openqa.selenium.WebDriver;

import org.openqa.selenium.firefox.FirefoxDriver;
//import org.openqa.selenium.chrome.ChromeDriver;


public class XmlServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //System.out.println("Hello from GET method.");
        PrintWriter writer = response.getWriter();
        writer.println("<h3></h3>");

        WebDriver driver = new FirefoxDriver();

        driver.get("http://google.com");

        writer.println(driver.getPageSource());

    }
}

UPDATE:

When i use HtmlUnitDriver it works 192.168.1.102:8080/JSPprojectServlets

clearly it can't open firefox for some reason. I'm in W7 64bit and have instaleld FF10 and still nothing.

Sunand Padmanabhan

Try giving the Firefox binary absolute path as a parameter in your code and when invoking from win7 provide this as in input to your JSP and then it could solve the problem. From your above stack trace it says firefox binary cannot be found in /usr/bin/firefox but you are trying to invoke the webdriver in win7 where the path is different.

Receiving org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH running tests in Selenium IDE with Webdriver playback

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Error using Selenium Webdriver and FireFox

From Dev

Selenium Webdriver clickAndHold() error on Firefox

From Dev

Selenium::WebDriver::Error with Firefox & Chrome

From Dev

Python Selenium cannot connect to Webdriver Firefox extension

From Dev

Selenium Python browser=webdriver.Firefox() error

From Dev

Selenium webdriver connect timeout

From Dev

Firefox profile setup throws error in protractor with selenium webdriver configuration

From Dev

Blank Firefox window with error message in eclipse in Selenium webdriver(JAVA)

From Dev

Firefox profile setup throws error in protractor with selenium webdriver configuration

From Dev

Blank Firefox window with error message in eclipse in Selenium webdriver(JAVA)

From Dev

Error exception is displayed when Selenium WebDriver Firefox executing in Java in Eclipse?

From Dev

Selenium WebDriver 2.44 Firefox 33

From Dev

Selenium Webdriver 2 with Firefox 26?

From Dev

Selenium firefox webdriver extension installation

From Dev

HTML in selenium firefox webdriver not loading

From Dev

Python: Selenium Firefox Webdriver failing with error: 'Can't load the profile...WARN addons.xpi..."

From Dev

Selenium Firefox webdriver via geckodriver results in error: 'geckodriver' executable needs to be in PATH

From Dev

Selenium webdriver not working with DOM elements in firefox 24.0

From Dev

Setting path to firefox binary on windows with selenium webdriver

From Dev

Selenium WebDriver: Firefox starts, but does not open the URL

From Dev

Selenium webdriver fails to start with Firefox 26+

From Dev

Can Selenium WebDriver automate Firefox toolbars?

From Dev

Firefox + Selenium WebDriver and download a csv file automatically

From Dev

Dropdown behaviour issue in FireFox using Selenium WebDriver

From Dev

Running multiple instances of selenium webdriver asynchronously (firefox)

From Dev

Is Selenium 2.42.2 webdriver compatible with Firefox 27.0.1?

From Dev

Trouble connecting Firefox WebDriver with Selenium in Python

From Dev

Firefox Selenium webdriver for play framework: How to upgrade?

From Dev

Disable hardware inputs on Selenium webdriver firefox

Related Related

  1. 1

    Error using Selenium Webdriver and FireFox

  2. 2

    Selenium Webdriver clickAndHold() error on Firefox

  3. 3

    Selenium::WebDriver::Error with Firefox & Chrome

  4. 4

    Python Selenium cannot connect to Webdriver Firefox extension

  5. 5

    Selenium Python browser=webdriver.Firefox() error

  6. 6

    Selenium webdriver connect timeout

  7. 7

    Firefox profile setup throws error in protractor with selenium webdriver configuration

  8. 8

    Blank Firefox window with error message in eclipse in Selenium webdriver(JAVA)

  9. 9

    Firefox profile setup throws error in protractor with selenium webdriver configuration

  10. 10

    Blank Firefox window with error message in eclipse in Selenium webdriver(JAVA)

  11. 11

    Error exception is displayed when Selenium WebDriver Firefox executing in Java in Eclipse?

  12. 12

    Selenium WebDriver 2.44 Firefox 33

  13. 13

    Selenium Webdriver 2 with Firefox 26?

  14. 14

    Selenium firefox webdriver extension installation

  15. 15

    HTML in selenium firefox webdriver not loading

  16. 16

    Python: Selenium Firefox Webdriver failing with error: 'Can't load the profile...WARN addons.xpi..."

  17. 17

    Selenium Firefox webdriver via geckodriver results in error: 'geckodriver' executable needs to be in PATH

  18. 18

    Selenium webdriver not working with DOM elements in firefox 24.0

  19. 19

    Setting path to firefox binary on windows with selenium webdriver

  20. 20

    Selenium WebDriver: Firefox starts, but does not open the URL

  21. 21

    Selenium webdriver fails to start with Firefox 26+

  22. 22

    Can Selenium WebDriver automate Firefox toolbars?

  23. 23

    Firefox + Selenium WebDriver and download a csv file automatically

  24. 24

    Dropdown behaviour issue in FireFox using Selenium WebDriver

  25. 25

    Running multiple instances of selenium webdriver asynchronously (firefox)

  26. 26

    Is Selenium 2.42.2 webdriver compatible with Firefox 27.0.1?

  27. 27

    Trouble connecting Firefox WebDriver with Selenium in Python

  28. 28

    Firefox Selenium webdriver for play framework: How to upgrade?

  29. 29

    Disable hardware inputs on Selenium webdriver firefox

HotTag

Archive