SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.53k stars 8.16k forks source link

getting unreachable browser exception after a while when I run testng.xml using maven OS : MAC #2049

Closed hemanthsridhar closed 8 years ago

hemanthsridhar commented 8 years ago

OS: MAC

Selenium Version: 2.53.0

Browser: All browsers

Expected Behavior - Not getting unreachable browser exception and the suite should run smoothly.

Actual Behavior - getting unreachable browser exception after a while on a regular basis. Sometimes executes completely, sometimes doesn't. (FYI the same code). Caused by: org.openqa.selenium.WebDriverException: java.net.SocketException: Bad file descriptor

Steps to reproduce - No idea

lukeis commented 8 years ago

We can't help you here without a way to reproduce your issue. You can try on the selenium-users Google group

hemanthsridhar commented 8 years ago

I am able to run the tests but right clicking the testng.xml file and run as testng suite. But I if I do the same using maven, I am not able to run. Here is my pom.xml. It just simply stops communicating after a while. I am running 8 different classes which contains different test methods. (@Test) . Please open the issue. I have tried for 2.53.0 version as well.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>ETNA</groupId>
    <artifactId>inhouse.NewStandardEcommerceTemplate</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <compiler.version>1.8</compiler.version>
        <allure.version>1.5.0.RC2</allure.version>
        <aspectj.version>1.8.5</aspectj.version>
        <version.selenium>2.50.1</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>

 <!-- custom excelread library using apachePOI -->   
    <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.13</version>
</dependency>

    <dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml</artifactId>
    <version>3.13</version>
</dependency>

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi-ooxml-schemas</artifactId>
    <version>3.13</version>
</dependency>

<!-- zipturnaround -->
    <dependency>
    <groupId>org.zeroturnaround</groupId>
    <artifactId>zt-zip</artifactId>
    <version>1.7</version>
    </dependency>

 <!-- java mail -->
    <dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.4.7</version>
</dependency>

        <!-- Selenium and Drivers -->
        <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>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.3.1</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>

    </dependencies>

    <build>
        <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.18.1</version>
                <configuration>
                <suiteXmlFiles>
                <suiteXmlFile>testng.xml</suiteXmlFile>
                </suiteXmlFiles>
                    <testFailureIgnore>true</testFailureIgnore>
                    <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>
                    <dependency>
                    <groupId>org.apache.maven.surefire</groupId>
                    <artifactId>surefire-testng</artifactId>
                    <version>2.18.1</version>
                    </dependency>
                </dependencies>
            </plugin>

            <!--Needed only to show reports locally. Run jetty:run and
            open localhost:8080 to show the report-->
            <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>
    </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>
lukeis commented 8 years ago

you need to provide a way for us to reproduce the problem, just including a pom doesn't cut it, also you seem to be looking for help troubleshooting the problem rather than alerting us to an issue in the selenium project.

Please troubleshoot your error first on the selenium-users mailing list and then report a concise test case showing any issue in the selenium product. https://groups.google.com/forum/#!forum/selenium-users

hemanthsridhar commented 8 years ago

@lukeis I did what you asked. The reason why I posted the pom.xml is because the suite is executing completely without encountering the exception when failsafe plugin is used. Using surefire plugin only, I am facing this issue. If you do see any sort of mistakes in my pom please do help me out. Do you think it is a surefire-plugin issue?

lukeis commented 8 years ago

This is not a help forum, the selenium-users list I've pointed you to is

hemanthsridhar commented 8 years ago

@lukeis do you have a bit bucket account? I actually gave this to chromedriver when the conclusion came to this https://github.com/cbeust/testng/issues/1040. I shared the project with him and he is facing the same. If you do have a bit bucket account let me know. I will share the project. If you don't I will make the project public so that you can clone it. I really feel you should look into this.