12

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.

4
  • does anyone have any idea? Commented Sep 24, 2013 at 17:49
  • 2
    I'm not sure I understand your setup. You have the WAR on a tomcat on a linux server and are trying to run your selenium project on a W7 machine with FF10, correct? Which of the machines throws that error? It looks like something thrown by a Linux machine but the Linux machine shouldn't be trying to start Firefox if I understood the setup correctly. Can you clarify? Oh, and does opening the URL manually on the windows machine work? Commented Sep 29, 2013 at 15:02
  • Is your war working fine on ubuntu andcan you access it on windows system? Which system Selenium is running on? Commented Oct 1, 2013 at 8:30
  • I was also facing the same issue since firefox update but then i degraded it and it started working Commented Mar 19, 2014 at 8:46

7 Answers 7

7
+50

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks! Not exactly what i wanted, still the best solution.
1

This happens when java client fails to connect to the Selenium instance on local host. If you are running on windows make sure that "127.0.0.1 localhost" lin in hosts file is commented. Hosts file will be available in C:\Windows\System32\drivers\etc folder.

This has fixed same issue, that i faced. This mainly happens if we are behind a proxy server.

2 Comments

thank you for the response....but it continues to give the same error. I am not running on localhost...only eclipse is on localhost for testing purposes. I put the .war file on my ubuntu server and then direct to the internal ip from my windows 7
Is selenium able to load a browser directly from a webpage? basically what i am doing is using JSP to create a webpage...is I would go to www.site.com/selenium.jsp and that webpage is supposed to load a new browser->go to url www.google.com -> search -> output data is this posible?
1

I had the same problem. Everywhere I was found root cause as version issue and really it was. This was sorted after migrating to latest version of Selenium Web Driver i.e. from 2.32 to 2.39 (As all other component like Java/Web browser etc are already up to date). All scripts are working fine now.

Comments

1

I too had same problem but somehow I've resolved this issue by,

  1. updating my JAR Files: selenium-java-2.43.0.jar to selenium-java-2.48.2.jar and selenium-server-standalone-2.43.1.jar to selenium-server-standalone-2.48.2.jar
  2. Added a new JAR file selenium-java-2.48.2-srcs.jar to lib

These changes made my code flawless in my case

Comments

0

I've experienced an issue like this with ChromeDriver, where I couldn't run tests because my chromedriver did not support my version of google chrome that i had installed on my computer.

Instead of installing an old version of firefox, and having a newer FirefoxDriver, make sure both are copacetic by updating both

Comments

0

I had the same error on deploying a war and testing with Selenium on Windows 7 and apache-tomcat-6.0.37:

org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:118) 

Since the tests were working before upgrading Firefox to v 27 (then 29). I tried reverting back to the earlier version of Firefox 18.0.2 (http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/18.0.2/win32/en-US/) and it worked.

Comments

0

update your selenium-java-*.jar file.

current version of selenium-java jar is selenium-java-2.48.2.jar

so please use updated jar.

if you don't want to update jar files, in that case disable your firefox update

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.