Selenium with Maven plugin does not work the tests

0
  • Implementation to run a JUnit and testNG test suite,
  • When run by the eclipse plugin, it works.
  • By maven not, the behavior of testNG tests are changed,
  • It seems like it does not end right the http sessions,
  • Create an http session, when (login logout)

The main lib's of pom, I've tried configuring it as apache's guidelines:

<dependency>
    <groupId>xml-apis</groupId>
    <artifactId>xml-apis</artifactId>
    <version>1.4.01</version>
</dependency>
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.0.0-beta2</version>
    <scope>test</scope>
    <exclusions>
    <exclusion>
        <artifactId>xml-apis</artifactId>
        <groupId>xml-apis</groupId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-test</artifactId>
    <version>4.2.4.RELEASE</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.9.10</version>
    <scope>test</scope>
</dependency>
<build>
    <finalName>${project.artifactId}</finalName>
    <pluginManagement>
        ....
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
        </plugin>
    </pluginManagement>
    </plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
                <properties>
                    <property>
                    <name>junit</name>
                    <value>false</value>
                    </property>
                </properties>
            <threadCount>1</threadCount>
            </configuration>
        <dependencies>
            <dependency>
                <groupId>org.apache.maven.surefire</groupId>
                <artifactId>surefire-junit47</artifactId>
                <version>2.19.1</version>
            </dependency>
            <dependency>
                <groupId>org.apache.maven.surefire</groupId>
                <artifactId>surefire-testng</artifactId>
                <version>2.19.1</version>
            </dependency>
        </dependencies>
        </plugin>
    </plugins>
    ...

Below are the results of the tests run by the Eclipse plugin:

===============================================
Default suite
Total tests run: 11, Failures: 0, Skips: 0
===============================================
  • The problem with the tests is that they work individually,
  • Taking testNG's set of classes (4) around the Eclipse plugin, it works,
  • Around the JUnit test suite (44) it works,
  • When both enter in HTTP sessions (created in NG test).

It looks like he's trying to log in, and before he even logs off, he starts the other class by logging in, but he still has not finished logging out. >

Login summary logout:

@BeforeClass(alwaysRun = true)
public void setUp() throws Exception
{
    baseUrl = SysCodeTest.URL_PATH_TEST;
    this.login();

@AfterClass(alwaysRun = true)
public void tearDown() throws Exception
{
    this.logout();
}

Someone has already gone through this, can you point out some configuration problem? below log error:

Failed tests: 
SysNGSeleniumDriverChromeTest.setUp:18 » Timeout timeout: cannot determine loa...
com.sys.mod.login.SysGroupControllerTest.(com.sys.mod.login.SysGroupControllerTest)
Run 1: SysGroupControllerTest.setUp:29->SysNGSeleniumDriverChrome.login:49 » NoSuchElement
Run 2: PASS

com.sys.mod.login.SysPaperControllerTest.(com.sys.mod.login.SysPaperControllerTest)
Run 1: PASS
Run 2: PASS
Run 3: SysPaperControllerTest>AbstractTestNGSpringContextTests.run:175->changePaper:101 » NoSuchElement
Run 4: SysPaperControllerTest>AbstractTestNGSpringContextTests.run:175->removePaper:130 » NoSuchElement
Run 5: SysPaperControllerTest>SysNGSeleniumDriverChrome.tearDown:86->SysNGSeleniumDriverChrome.logout:60 » NoSuchElement

com.sys.mod.login.SysUserControllerTest.(com.sys.mod.login.SysUserControllerTest)
Run 1: SysUserControllerTest.setUp:29->SysNGSeleniumDriverChrome.login:49 » NoSuchElement
Run 2: PASS
Run 3: SysUserControllerTest>SysNGSeleniumDriverChrome.tearDown:86->SysNGSeleniumDriverChrome.logout:60 » NoSuchElement
    
asked by anonymous 26.09.2016 / 22:59

0 answers