Unable to bind to locking port 7054 within 45000 ms

1,123 views
Skip to first unread message

atul parate

unread,
Jul 22, 2014, 3:33:57 AM7/22/14
to webd...@googlegroups.com
My Code :-

package scripts;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Main
{
public static void main(String args[]) throws Exception
{
WebDriver dr = null;
//String browser = "Firefox";
dr = new FirefoxDriver();
dr.get("www.google.co.in");
Thread.sleep(3000);
dr.quit();
System.out.println("Hi");
}
}


Error:-
Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:30'
System info: host: 'PDCDT015GJYVQ1', ip: '10.77.13.66', os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_65'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:98)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:84)
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:95)
at scripts.Main.main(Main.java:15)


Can anyone please help me in this? I am struggling to sort out this issue. :(

Aashish Mishra

unread,
Jul 28, 2014, 11:00:44 AM7/28/14
to webd...@googlegroups.com
I Re-framed the code as below -
Run this 

package scripts;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

public class Main
{
public static void main(String args[]) throws Exception
{
WebDriver dr = new FirefoxDriver();
//String browser = "Firefox";
dr.get("http://www.google.co.in");

Elangovan Ganesan

unread,
Jul 28, 2014, 12:23:13 PM7/28/14
to webd...@googlegroups.com

This is firefox browser version problem.. check the selenium jar you use supports the firefox version of urs.

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

taru

unread,
Jul 28, 2014, 3:34:42 PM7/28/14
to webd...@googlegroups.com
I hit this issue recently and it was due to the incompatibility between firefox and webdriver version. you may want to check your classpath to have correct libraries included. i am now using FFv31 and WebDriver 2.42 and is working fine. there may be other reasons too.

darrell

unread,
Jul 28, 2014, 11:09:29 PM7/28/14
to webd...@googlegroups.com
I see a few problems there. The idea that your version of Firefox and Selenium are not compatible is one possible thing to watch for. If you go to http://selenium-release.storage.googleapis.com/index.html and drill down on 2.42.2 you will see that it was published 03-Jun-2014. If you go to https://wiki.mozilla.org/Releases you will see that Firefox 30.0 was published AFTER 03-Jun-2014. So you cannot use Selenium 2.42.2 with Firefox 30.0 or higher. Firefox 29.0.1 was published 09-May-2014. So when they were publishing Selenium 2.42.2 it would have been tested against Firefox 29.0.1.

Another problem is that you are passing in the string "www.google.co.in". I'm not sure if FirefoxDriver 2.42.2 takes care of this for you but this is not a proper URL. You REALLY should get into the habit of using "http://www.google.co.in".

Finally, if anything goes wrong (not likely with this example but will with more complex tests) the dr.quit() code will never get reached and Selenium will not shut down cleanly. What I would recommend is:

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

import static org.openqa.selenium.browserlaunchers.Sleeper.sleepTightInSeconds;

public class TestSelenium {
    private WebDriver driver;

    @Before
    public void setUp() {
        driver = new FirefoxDriver();
        driver.manage().window().maximize();
        driver.get("http://www.google.co.in");
    }

    @Test
    public void test1() {
        sleepTightInSeconds(3);
    }

    @After
    public void tearDown() {
        if(driver != null) {
            driver.quit();
        }
    }
}

With this example and the properly configured project you can put your test snippets in the test1() method. Once you get it working you can copy and paste it into your actual test suite. You can also add more test methods (e.g. test2(), test3(), etc.) and run them all to see how things work. If there is a test you want to keep, for reference, but not run all the time you can add an @Ignore above the @Test to prevent the test from running.
Reply all
Reply to author
Forward
0 new messages