testng-team / testng

TestNG testing framework
https://testng.org
Apache License 2.0
1.98k stars 1.02k forks source link

Getting Unreachable browser exception after a while when I am running the TestNG tests. OS : MAC #1040

Closed hemanthsridhar closed 8 years ago

hemanthsridhar commented 8 years ago

I am running my tests in MAC as well as in Windows. In windows, the code works like a charm. In MAC OSX, I run the same code and it will be working fine BUT after a while I get unreachable browser exception. I am running my test through maven surefire plugin. maven version : 3.3.9 surefire plugin : 2.19.1 testng version : 6.9.10 java.version: 1.8.0_77

Here is my stacktrace

UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Hemanths-MacBook-Pro.local', ip: '192.168.0.8', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.4', java.version: '1.8.0_77'
Driver info: driver.version: RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={userDataDir=/var/folders/cd/vbgjmfqj67s2_7lxl03xm5wc0000gn/T/.org.chromium.Chromium.uH5fCE}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=50.0.2661.94, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 900637934c566c1fb4ddc890c4eaaa10
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Hemanths-MacBook-Pro.local', ip: '192.168.0.8', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.4', java.version: '1.8.0_77'
Driver info: driver.version: RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, chrome={userDataDir=/var/folders/cd/vbgjmfqj67s2_7lxl03xm5wc0000gn/T/.org.chromium.Chromium.uH5fCE}, takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=50.0.2661.94, platform=MAC, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 900637934c566c1fb4ddc890c4eaaa10
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:665)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:500)
    at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355)
    at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:69)
    at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:38)
    at com.sun.proxy.$Proxy16.isDisplayed(Unknown Source)
    at org.openqa.selenium.support.ui.ExpectedConditions.elementIfVisible(ExpectedConditions.java:302)
    at org.openqa.selenium.support.ui.ExpectedConditions.access$100(ExpectedConditions.java:41)
    at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:288)
    at org.openqa.selenium.support.ui.ExpectedConditions$10.apply(ExpectedConditions.java:285)
    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:238)
    at org.etna.utils.Waiting.explicitWaitVisibilityOfElement(Waiting.java:36)
    at org.etna.customer.pageobjects.HomePageObjects.waitForProfileDropdownLink(HomePageObjects.java:508)
    at org.etna.modules.LoginModuleTest.TC_Login_009_010_RememberPassword_UserNameAndPasswordRefill(LoginModuleTest.java:115)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:86)
    at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:197)
    at org.etna.maincontroller.MainController.run(MainController.java:208)
    at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:209)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:820)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1128)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
    at org.testng.TestRunner.privateRun(TestRunner.java:782)
    at org.testng.TestRunner.run(TestRunner.java:632)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:366)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319)
    at org.testng.SuiteRunner.run(SuiteRunner.java:268)
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1244)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1169)
    at org.testng.TestNG.run(TestNG.java:1064)
    at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:281)
    at org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:75)
    at org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:121)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Caused by: org.openqa.selenium.WebDriverException: java.net.SocketException: Bad file descriptor
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
System info: host: 'Hemanths-MacBook-Pro.local', ip: '192.168.0.8', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.4', java.version: '1.8.0_77'
Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:91)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644)
    ... 45 more
Caused by: java.net.SocketException: Bad file descriptor
    at java.net.SocketOutputStream.socketWrite0(Native Method)
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
    at org.apache.http.impl.conn.LoggingOutputStream.write(LoggingOutputStream.java:77)
    at org.apache.http.impl.io.SessionOutputBufferImpl.streamWrite(SessionOutputBufferImpl.java:126)
    at org.apache.http.impl.io.SessionOutputBufferImpl.flushBuffer(SessionOutputBufferImpl.java:138)
    at org.apache.http.impl.io.SessionOutputBufferImpl.flush(SessionOutputBufferImpl.java:146)
    at org.apache.http.impl.io.ContentLengthOutputStream.flush(ContentLengthOutputStream.java:101)
    at org.apache.http.entity.ByteArrayEntity.writeTo(ByteArrayEntity.java:117)
    at org.apache.http.impl.DefaultBHttpClientConnection.sendRequestEntity(DefaultBHttpClientConnection.java:158)
    at org.apache.http.impl.conn.CPoolProxy.sendRequestEntity(CPoolProxy.java:162)
    at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:237)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:122)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:271)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:55)
    at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:144)
    at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:90)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)

PFB my TestNG.xml file

<suite name="Etna Automation Suite">
    <listeners>
            <listener class-name="org.etna.maincontroller.MainController"/>
            <listener class-name="org.etna.utils.ReportGenerator"/>
    </listeners>
  <test name="End to End Testing">
    <groups>
    <run>
    <include name="regression"/>
    </run>
    </groups>

    <classes>
      <class name="org.etna.modules.ShopByBrandsModuleTest"/>
      <class name="org.etna.modules.GeneralSearchModuleTest"/>
      <class name="org.etna.modules.PDPModuleTest"/>
      <class name="org.etna.modules.ShopByManufacturersModuleTest"/>
      <class name="org.etna.modules.LoginModuleTest"/>
      <class name="org.etna.modules.MyCartModuleTest"/>
      <class name="org.etna.modules.CategoryModuleTest"/>
      <class name="org.etna.modules.HomePageModuleTest"/>
      <class name="org.etna.modules.APAModuleTest"/>
    </classes>
  </test>
</suite> 

_Each class contains atleast 20 test cases each. _

Here is my pom.xml too.

   <modelVersion>4.0.0</modelVersion>
    <groupId>ETNA</groupId>
    <artifactId>inhouse.NewStandardEcommerceTemplate</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <compiler.version>1.7</compiler.version>
        <allure.version>1.5.0.RC2</allure.version>
        <aspectj.version>1.8.9</aspectj.version>
        <version.selenium>2.53.0</version.selenium>
         <version.slf4j>1.7.7</version.slf4j>
    </properties>
    <name>ETNA</name>
    <description>New standard ecommerce template</description>
    <dependencies>
     <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
    <artifactId>jackson-databind</artifactId>
    <version>2.7.0</version>
  </dependency>
    <dependency>
    <groupId>com.pojosontheweb</groupId>
    <artifactId>monte-repack</artifactId>
    <version>1.0</version>
    </dependency>
    <dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>6.9.10</version>
  <scope>test</scope>
</dependency>
    <dependency>
    <groupId>com.jayway.restassured</groupId>
    <artifactId>rest-assured</artifactId>
    <version>2.9.0</version>
    </dependency>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-firefox-driver</artifactId>
        <version>${version.selenium}</version>
    </dependency>
    <dependency>
    <groupId>org.zeroturnaround</groupId>
    <artifactId>zt-zip</artifactId>
    <version>1.7</version>
    </dependency>
    <dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4.7</version>
</dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${version.selenium}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-server</artifactId>
    <version>${version.selenium}</version>
</dependency>
        <dependency>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-testng-adaptor</artifactId>
            <version>${allure.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.hamcrest</groupId>
            <artifactId>hamcrest-all</artifactId>
            <version>1.3</version>
        </dependency>
     <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>${version.slf4j}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>${version.slf4j}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <version>${version.slf4j}</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <version>${version.slf4j}</version>
            <scope>test</scope>
        </dependency>
         <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjtools</artifactId>
            <version>${aspectj.version}</version>
          </dependency>
           <dependency>
                   <groupId>org.aspectj</groupId>
                   <artifactId>aspectjrt</artifactId>
                    <version>${aspectj.version}</version>
                    </dependency>     
    </dependencies>
    <build>
<pluginManagement>
     <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <source>${compiler.version}</source>
                    <target>${compiler.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                 <suiteXmlFiles>
                    <suiteXmlFile>testng.xml</suiteXmlFile>
                 </suiteXmlFiles>
                    <argLine>-javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar</argLine>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.2.10.v20150310</version>
                <configuration>
                    <webAppSourceDirectory>${project.build.directory}/site/allure-maven-plugin</webAppSourceDirectory>
                    <stopKey>stop</stopKey>
                    <stopPort>1234</stopPort>
                </configuration>
            </plugin>
        </plugins>
</pluginManagement>
    </build>
    <reporting>
        <excludeDefaults>true</excludeDefaults>
        <plugins>
            <plugin>
                <groupId>ru.yandex.qatools.allure</groupId>
                <artifactId>allure-maven-plugin</artifactId>
                <version>2.5</version>
                  <configuration>
                    <reportVersion>${allure.version}</reportVersion>
                </configuration>
            </plugin>
        </plugins>
    </reporting>
</project>

Again, reminding you that the tests work perfectly fine windows machine. OSX version : 10.11.4 . I hope I can get a fix for this.

Also, Right clicking the testng.xml and clicking on run as testng suite IS WORKING FINE.

rouke-broersma commented 8 years ago

This has nothing to do with TestNG, file an issue with chrome webdriver: https://bugs.chromium.org/p/chromedriver/issues/list

juherr commented 8 years ago

I don't know if the problem comes from Chrome, but you should ask it on selenium project before here ;)

Feel free to reopen the issue when you will have more detail on a testng issue.

rouke-broersma commented 8 years ago

He already did file a bug report with selenium https://github.com/SeleniumHQ/selenium/issues/2049

hemanthsridhar commented 8 years ago

@Mobrockers Thank you. :) . I really don't think this is a chromedriver issue because it is not working in firefoxdriver and safari too. The execution simply stops. @juherr I wish I had more info :). I have raised it to https://issues.apache.org/jira/browse/SUREFIRE-1245 . Can you please add if you have any inputs on what the developer has replied in the comments section ?

juherr commented 8 years ago

Ok thank, I will try to follow the discussion you have with @Tibor17

The best thing you can do is find a way to reproduce the issue in a project you can share. It will be easier to find where is the problem and how to fiw it.

rouke-broersma commented 8 years ago

Perhaps your issue is related to https://somethingididnotknow.wordpress.com/2014/07/23/forkedbooter-steals-window-focus-on-mac-os-while-maven-is-running/

On Tue, May 10, 2016, 16:52 Hemanth Sridhar notifications@github.com wrote:

@Mobrockers https://github.com/Mobrockers Thank you. :) . I really don't think this is a chromedriver issue because it is not working in firefoxdriver and safari too. The execution simply stops. @juherr https://github.com/juherr I wish I had more info :). I have raised it to https://issues.apache.org/jira/browse/SUREFIRE-1245 . Can you please add if you have any inputs on what the developer has replied in the comments section ?

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/cbeust/testng/issues/1040#issuecomment-218182388

juherr commented 8 years ago

@hemanthsridhar If the issue is maven related, could you try to run your tests in Windows from your IDE?

hemanthsridhar commented 8 years ago

@juherr If you see the first thing that I have mentioned in this issue, you will get the answer. It is working absolutely fine using windows.

hemanthsridhar commented 8 years ago

@Mobrockers seems like a long shot. Will try it though.

juherr commented 8 years ago

Yes, sorry. I wanted to say osx.

The goal is to determine between all layers which one is failing.

If the tests are working well from the ide without maven, we will be able to exclude it from the list of suspects.

hemanthsridhar commented 8 years ago

@juherr No issues :). Anyways, you want me right click and run as testng suite from the IDE?

hemanthsridhar commented 8 years ago

@juherr I checked it from the IDE. receiving unreachable browser exception again.

hemanthsridhar commented 8 years ago

@juherr I ran from testng.xml but it worked fine on that particular day. I really don't know what is going on here now. :(

hemanthsridhar commented 8 years ago
screen shot 2016-05-11 at 1 24 16 am
hemanthsridhar commented 8 years ago

@juherr @Tibor17 for proof.

rouke-broersma commented 8 years ago

Are you not opening too many concurrent browser sessions, grinding your system to a stop, causing selenium to lose connection to the browser?

On Tue, May 10, 2016, 21:55 Hemanth Sridhar notifications@github.com wrote:

@juherr https://github.com/juherr for proof.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/cbeust/testng/issues/1040#issuecomment-218271901

hemanthsridhar commented 8 years ago

I am not doing anything of that sort. It is just a simple execution of test cases.(Like I told you, working like a charm in Windows).@Mobrockers

hemanthsridhar commented 8 years ago

@Mobrockers Please see my testng.xml that I have given in the issue.

rouke-broersma commented 8 years ago

I was assuming that when you say running on osx you also mean a different machine. A different machine could mean different hardware limitations that's why I'm asking. Starting a browser instance is not cheap, but should not matter unless running tests concurrent. Which is when it adds up. It's kind of hard to read a pomfile in a github issue on mobile, was easier to just ask you.

On Tue, May 10, 2016, 22:04 Hemanth Sridhar notifications@github.com wrote:

I am not doing anything of that sort. It is just a simple execution of test cases.(Like I told you, working like a charm in Windows).@Mobrockers https://github.com/Mobrockers

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/cbeust/testng/issues/1040#issuecomment-218274287

hemanthsridhar commented 8 years ago

@Mobrockers Alright. Did not know that. Ask me anything, I will reply again. Just want this issue to get fixed. If you guys want I can drop a screenshot that it is working fine in windows. And the answer is no. I am not running any concurrent tests.

hemanthsridhar commented 8 years ago

windowstestngscreenshot

hemanthsridhar commented 8 years ago

check the os.name in every screenshot.

juherr commented 8 years ago

Ok, so if I understand well, now you reproduce the issue with eclipse on Windows too?

rouke-broersma commented 8 years ago

The windows screenshot is showing a different error message it seems like.

juherr commented 8 years ago

True, but it is not the same test. Difficult to conclude something.

And on the OSX one, I read "Bad File descriptor". Definitely, I think the solution will come from the selenium community.

rouke-broersma commented 8 years ago

@juherr The error shown in his windows screenshot looks like a selenium TimeoutException on finding an element on the page, as in a normal exception that one would expect while running a selenium test. Perhaps the screenshot is to show us that it is working fine on windows, not that he can reproduce the same issue on windows.

hemanthsridhar commented 8 years ago

@Mobrockers You are absolutely right. I wanted to show that the suite executed completely in windows and not in MAC. @juherr Hope you got whatever I was trying to intend. And yes, I replicated the same again in windows as well as MAC using the testng.xml inside the IDE(eclipse).

hemanthsridhar commented 8 years ago

@juherr If you want I can share the screenshot for the same test case. It is the same suite. In Windows it executed completely. In MAC it stopped. Kindly reply back if you want the screenshot.

juherr commented 8 years ago

@hemanthsridhar It is still a bit confure for me.

No need to have screenshots, but could you just run only 1 test from your suite which is supposed to run well in some cases and fails in some other cases?

I see 4 tests:


I had a deeper look at your stracktrace and the root issue is:

Caused by: java.net.SocketException: Bad file descriptor at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:153)

As it is native code, it is not a huge surprise to see some differences between different os.

I found a similar stacktrace somewhere else: https://bugzilla.zimbra.com/show_bug.cgi?id=42870 I suppose osx is more strict than windows... (again without surprise)

rouke-broersma commented 8 years ago

One thing I would like to see is this same error with a browser that is not chrome. Because I still think this is an issue with chromedriver specifically.

On Wed, May 11, 2016, 17:36 Julien Herr notifications@github.com wrote:

@hemanthsridhar https://github.com/hemanthsridhar It is still a bit confure for me.

No need to have screenshots, but could you just run only 1 test from your suite which is supposed to run well in some cases and fails in some other cases?

I see 4 tests:

  • windows + maven
  • windows + eclipse
  • osx + maven
  • osx + eclipse

I had a deeper look at your stracktrace and the root issue is:

Caused by: java.net.SocketException: Bad file descriptor at java.net.SocketOutputStream.socketWrite0(Native Method) at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109) at java.net.SocketOutputStream.write(SocketOutputStream.java:153)

As it is native code, it is not a huge surprise to see some differences between different os.

I found a similar stacktrace somewhere else: https://bugzilla.zimbra.com/show_bug.cgi?id=42870 I suppose osx is more strict than windows... (without surprise)

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/cbeust/testng/issues/1040#issuecomment-218497867

hemanthsridhar commented 8 years ago

@juherr windows + maven - Working perfectly.
windows + eclipse - Working perfectly. osx + maven - Getting error. osx + eclipse - Getting error. Will send the screenshot for the one which failed in MAC and which passed in Windows.

@Mobrockers Will try to generate in a different browser by tonight(IST) and will send.

hemanthsridhar commented 8 years ago

@juherr then the issue is related to?

juherr commented 8 years ago

For me, it is an osx limitation with its default resources configuration.

But as @Mobrockers proposed, you should try with another selenium driver.

hemanthsridhar commented 8 years ago

Will try with firefox and get back to you guys.

hemanthsridhar commented 8 years ago

@Mobrockers It is so weird. I ran my test through Firefoxdriver today and it is working perfectly. The other day I did the same and it didn't work. If I face the same I will get back to you guys. @Mobrockers and @juherr Can you guys please do me a favour? Can you please ask the selenium developer to open the bug again? I had asked him to open it but he didn't. He felt that it was a tutorial.

Thank you so much for your help guys. Please close this issue.

PS : Will get back to the same bug if I face the same using Firefox.(which I did).

hemanthsridhar commented 8 years ago

Bug raised : https://bugs.chromium.org/p/chromedriver/issues/detail?id=1376

hemanthsridhar commented 8 years ago
screen shot 2016-05-19 at 1 06 59 pm screen shot 2016-05-19 at 1 07 24 pm
hemanthsridhar commented 8 years ago

Occurring for firefox now. Please open this issue if required and get this resolved if it is from your end.

juherr commented 8 years ago

As I think it is more a Selenium issue than a TestNG one, I propose you try to find help on its mailing list: https://groups.google.com/forum/#!forum/selenium-users

rouke-broersma commented 8 years ago

Since no one else seems to be reporting this particular bug, and you manage to reproduce it consistently across browsers but not systems, I would rather say it's got something to do with your particular hardware + software setup. Have you tried running your testsuite on someone else's mac? In any case like @juherr said you should probably ask in the selenium users group.

Also I just saw in the selenium issue you created that you do not get this problem running your tests in failsafe. Since failsafe is designed to run integration-tests (which selenium tests are) the quick fix for you would be to simply use failsafe. There's really no reason at all NOT to use failsafe for selenium tests.

hemanthsridhar commented 8 years ago

@Mobrockers I am using allure reports which is dependent on surefire. Anyways, you are right, I will try to set up in someone else's MAC and see whether it works. Will get back to you guys.

hemanthsridhar commented 8 years ago

Can I share you guys my repo so that you guys can clone it and check please? This is really important. It would mean alot if you guys helped me with this. I really don't see any issue in configuration. Can you guys please check?

rouke-broersma commented 8 years ago

I do not have a mac, sorry. Perhaps @remcowesterhoud can help you.

hemanthsridhar commented 8 years ago

okay. thank you.

hemanthsridhar commented 8 years ago

@juherr can you help me with this please?

hemanthsridhar commented 8 years ago

@juherr https://groups.google.com/forum/#!searchin/selenium-users/unreachable/selenium-users/Hp7MenNlIDU/UBGiTHZlBAAJ

I had done this long back. No one replied though.

hemanthsridhar commented 8 years ago

@Mobrockers does any problem occur if we delete test-output folder? No right? Because I started getting this issue(firefox) once I deleted that folder and pushed the code to bitbucket.

hemanthsridhar commented 8 years ago

https://bitbucket.org/hemanthsridhar/etna if you can help. Master branch contains the latest code.

rouke-broersma commented 8 years ago

I don't see how that could have an effect on selenium, no. Sorry

On Thu, May 19, 2016, 20:46 Hemanth Sridhar notifications@github.com wrote:

@Mobrockers https://github.com/Mobrockers does any problem occur if we delete test-output folder? No right? Because I started getting this issue(firefox) once I deleted that folder and pushed the code to bitbucket.

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/cbeust/testng/issues/1040#issuecomment-220415774

rouke-broersma commented 8 years ago

Nothing in your configuration or source code stands out to me.