If you get the “Could not start Selenium Session : Connection timed out” while running a test scenario it is usually due to the ports not matching for the Server and the client and results in “Selenium server not able to make a connection with the local client machine”.

a sample error message:

 java.lang.RuntimeException: Could not start Selenium session: Connection timed out: connect
at com.thoughtworks.selenium.DefaultSelenium.start(DefaultSelenium.java:89)
at com.ibm.lconn.files.test.ui.BaseFilesSeleniumTestCase.setUp(BaseFilesSeleni umTestCase.java:54)
at junit.framework.TestCase.runBare(TestCase.java:128)
at com.thoughtworks.selenium.SeleneseTestCase.runBare(SeleneseTestCase.java:21 2)
at junit.framework.TestResult$1.protect(TestResult.java:106) 

The solution for it is to make sure to run the on the same ports. The default port where the selenium server starts up is 4444.

Similar Posts from the author: