user2018017
user2018017

Reputation: 75

Selenium WebDriver unable to bind to locking port

I am new to the selenium.I am running testcases and I am getting the following exception:

org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 20:21:18'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver
Command duration or timeout: 46.68 seconds
Build info: version: '2.28.0', revision: '18309', time: '2012-12-11 15:53:30'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0'
Driver info: org.openqa.selenium.remote.RemoteWebDriver


at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)

I have installed firefox version 18,and try lots of solution but still geting the same error.please help me out. Thanks in advance.

Upvotes: 2

Views: 3967

Answers (3)

Ben
Ben

Reputation: 667

There are some causes for a test to be unable to bind to the locking port. One of the most common is that you do not set a new instance of your Webdriver for each test that you run, or that you have an existing instance of the webdriver that has not been closed.

If you do not give it a new instance, then Firefox can have multiple instances that may conflict with one another. Creating a new instance is very simple to add to your code. This can be done in one of two ways. The first way, would be to declare a new driver for each test run.

IWebDriver driver = new FirefoxDriver();

The second is to assign it a specific profile to use. If you want to assign a specific firefox profile to the instance (to just use the bare minimum of the browser) you can use the following code

FirefoxProfile yourProfile = new FirefoxProfile(@"Filepath of the custom profile");
using(IWebDriver driver = new FirefoxDriver(yourProfile))
{
    //Perform your test here
}

Another cause can be that the last test failed to properly close the webdriver. At the end of your test, just add a way to close your instance. This can be done with a simple

driver.Close();

More information on this topic from other users can be found here https://groups.google.com/forum/#!topic/selenium-users/scHVivMEYDc

Upvotes: 2

user2365657_Shraddha S
user2365657_Shraddha S

Reputation: 253

Solution 1 - update Firefox version to v19 and selenium version to version 2.31

Solution 2 - or else follow following steps:- Steps:- 1. Go to following path C:\Windows\System32\drivers\etc 2. And comment out : 127.0.0.1 localhost

Upvotes: 2

Roman Grytsay
Roman Grytsay

Reputation: 21

According to the changelist, FF18 is supported since WebDriver 2.29.0 version.
So check out the latest version here: http://docs.seleniumhq.org/download/

Or use direct link: selenium.googlecode.com/files/selenium-java-2.33.0.zip

Upvotes: 2

Related Questions