java.net.SocketException: Software caused connection abort: socket write error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

java.net.SocketException: Software caused connection abort: socket write error

Krithi
Hi Tarun,

I am getting the error : java.net.SocketException, when I tried with the Data Provider. I have two rows of objects as we discussed in the previous session. For the first run, it is running fine. But for the second run, it is not executing, instead it shows the below error :

===============================================
    Default test
    Tests run: 2, Failures: 1, Skips: 0
===============================================

java.net.SocketException: Software caused connection abort: socket write error
        at java.net.SocketOutputStream.socketWrite0(Native Method)
.
.
.

It should be the problem with closing of the browser. Did you faced before? I am also trying to figure out , but wanted to address this if you could provide any solution.

Note: I tried it Chrome and IE , its the same behavior. In Firefox, Its not opening the Homepage though. I am trying to figure it out.

Thanks
Krithi
Reply | Threaded
Open this post in threaded view
|

Re: java.net.SocketException: Software caused connection abort: socket write error

softwaretestingforum
Administrator
Please post your source code also, it is difficult to debug with out that.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: java.net.SocketException: Software caused connection abort: socket write error

Krithi
Sure Tarun. Please refer the attached files for your reference.

PageObjectExample.java - My Test class and I have the test method testRegistrationNew. It inherits MercuryTestCase
MercuryTestCase.java - Class where I am initiating the before and after Test.
Registration.java - is my Page object for the registration
RegistrationData.java - is my data class

Let me know If you need anyother inputs from me.

Thanks
RegistrationData.java
PageObjectExample.java
MercuryTestCase.java
Registration.java
Reply | Threaded
Open this post in threaded view
|

Re: java.net.SocketException: Software caused connection abort: socket write error

softwaretestingforum
Administrator
Can you change your annotations in MercuryTestCase class to @BeforeMethod and @AfterMethod
@Before/After Test denotes to test tag in testng.xml file.
~ seleniumtests.com
Reply | Threaded
Open this post in threaded view
|

Re: java.net.SocketException: Software caused connection abort: socket write error

Krithi
Hi Tarun,

Thanks for the solution. It worked. After changing to BeforeMethod and AfterMethod instead of BeforeTest and AfterTest, I can see it is running with different data. My assumption for , BeforeTest has to be executed instead of every test instead of every method. Thanks for spotting it out.

Regards
Krithi