How to Resolve SocketException In Selenium for Internet Explorer and Chrome

Spread the love

Many a times we get the below written Socket exception in Selenium. I am giving a sample stack trace.It happens mostly with IE and Chrome.

Listening on port 36550
Nov 22, 2014 5:02:14 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception ( caught when processing request: Software caused connection abort: recv failed
Nov 22, 2014 5:02:14 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Exception in thread “main” org.openqa.selenium.remote.SessionNotFoundException: Unable to get browser (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 16 milliseconds
Build info: version: ‘2.41.0’, revision: ‘3192d8a’, time: ‘2014-03-27 17:18:15’
System info: host: ‘LQA1008’, ip: ‘’, ‘Windows 7’, os.arch: ‘x86’, os.version: ‘6.1’, java.version: ‘1.7.0_55’
Session ID: 06ab6b34-1bd4-4ee6-979c-76e4fc741458

The issue is Session could not find the URL triggered using the method driver.get(“”) due to initial proxy URL (Ex: http://localhost/portNumber).
so we need to use driver.get method in a different manner. How lets see in the below section:

File file =new File("C:\Users\Susanth\lib\IEDriverServer64.exe");
System.setProperty("", file.getAbsolutePath());
DesiredCapabilities cap= new DesiredCapabilities();
cap.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
cap.setCapability("initialBrowserUrl", URL);
driver=new InternetExplorerDriver(cap);

Also if you don’t want to use INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS , then check this blog-

Spread the love
READ  How to handle Windows Security Pop-Up Window In Different Browsers
I am the founder and owner of the blog -, always love to share knowledge on test automation,tools,techniques and tips.I am a passionate coder of Java and VBScript.I also publish articles on Travel ideas and great honeymoon destinations.Apart from these, I am a gear-head,love to drive across India. I have shared lots of articles here on How to travel several parts of India.Customization of cars aka car modification is my another hobby.Get in touch with me on


Please enter your comment!
Please enter your name here