depends on nonexistent group "homePage" error

1,323 views
Skip to first unread message

Settaluri Karthik Sriharsha

unread,
May 24, 2017, 10:32:10 PM5/24/17
to testng-users
Say for example I've a UntilLogin, PostLogin classes containing the following piece of code : 

class UntilLogin() {


@Test(groups=preSetup1)
public void test_setup1() {
button
.click() // some action 1
}


@Test(dependsOnGroups=preSetup1, groups=preSetup2)
public void test_setup2() {
button
.click()  // some action 2
}


@Test(dependsOnGroups=preSetup2, groups=preSetup3)
public void test_setup3() {
button
.click() // some action 3
}


@Test(dependsOnGroups=preSetup3, groups=preSetup4)
public void test_setup4() {
// perform login
}


@Test(dependsOnGroups=preSetup4, groups=preSetup5)
public void test_setup5() {
// wait for splash screen to appear and click
}


@Test(dependsOnGroups=preSetup5, groups=homePage)
public void test_homePage() {
// wait for the elements to appears
}






class PostLogin() {


@Test(dependOnGroups=homePage, groups=postgroup)
public void test_postLogin() {
//
}


When i try to do maven install on this - I get the following error "of Nonexistent Group" 

Enter code he[INFO] Results:

[INFO] 

[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO] 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD FAILURE

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 3.564 s

[INFO] Finished at: 2017-05-25T01:57:42+05:30

[INFO] Final Memory: 25M/278M

[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.20:test (default-test) on project android: There are test failures.

[ERROR] 

[ERROR] Please refer to /Users/ssrihar/Documents/workspace/android/testapp/relay/android/target/surefire-reports for the individual test results.

[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.

[ERROR] There was an error in the forked process

[ERROR] 

[ERROR] DependencyMap::Method "ListsTest.test_listsHomePage()[pri:0, instance:com.sears.relay.android.ListsTest@5a61f5df]" depends on nonexistent group "HomePageGroup"

[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process

[ERROR] 

[ERROR] DependencyMap::Method "PostLogin.test_postLogin()[pri:0. PostLogin@5a61f5df]" depends on nonexistent group "homePage"

[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:665)

[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)

[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:279)

[ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:243)

[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1077)

[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:907)

[ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:785)

[ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)

[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)

[ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)

[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)

[ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)

[ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)

[ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)

[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)

[ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)

[ERROR] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)

[ERROR] at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)

[ERROR] at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)

[ERROR] at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)

[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[ERROR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

[ERROR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

[ERROR] at java.lang.reflect.Method.invoke(Method.java:498)

[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)

[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)

[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)

[ERROR] at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

[ERROR] -> [Help 1]re...

Kindly help me out in resolving this issue.


⇜Krishnan Mahadevan⇝

unread,
May 25, 2017, 2:10:59 AM5/25/17
to testng...@googlegroups.com

Please show us how does your suite xml look like. Hard to say without seeing it's contents.


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to testng-users...@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
--

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Settaluri Karthik Sriharsha

unread,
May 25, 2017, 4:23:00 AM5/25/17
to testng-users







<?xml version="1.0" encoding="UTF-8"?>


<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">


<suite name="Suite" parallel="none">


  <test name="Login_ClickLists_SelectListSelectItemAndOrderTest">

    <classes>


       <class name="com.test.myapp.android.UntilLogin">


        <methods>


                <include name="testSetup1" />


                <include name="testSetup2" />


                <include name="testSetup3" />


                <include name="testSetup4" />


                <include name="testSetup5" />


                <include name="testHomePage" />


        </methods>


       </class>


       <class name="com.test.myapp.android.PostLogin">


       <methods>


                <include name="test_postLogin" />


        </methods>


       </class>


    </classes>


  </test> <!-- Test -->


</suite> <!-- Suite -->



This is how my sample test suite looks. Please let me know if I'm correct.

⇜Krishnan Mahadevan⇝

unread,
May 25, 2017, 4:27:28 AM5/25/17
to testng...@googlegroups.com

Please double check if you have mentioned the method names properly for com.test.myapp.android.UntilLogin

Based on what you shared as the xml contents all the method names in this class are missing an "_" (underscore )

Settaluri Karthik Sriharsha

unread,
May 25, 2017, 4:30:15 AM5/25/17
to testng-users
Please note that I've changed the methods and class names and thus the below

[ERROR] DependencyMap::Method "ListsTest.test_listsHomePage()[pri:0, instance:com.sears.relay.android.ListsTest@5a61f5df]" depends on nonexistent group "HomePageGroup"


maps to 

[ERROR] DependencyMap::Method "PostLogin.test_postLogin()[pri:0, instance:com.sears.relay.android.ListsTest@5a61f5df]" depends on nonexistent group "homePage"

Settaluri Karthik Sriharsha

unread,
May 25, 2017, 4:52:32 AM5/25/17
to testng-users
Kindly let me know how to include group dependency if required instead of methods. 

Or groups and methods dependency if required.

Hoang Nguyen

unread,
May 25, 2017, 6:08:27 AM5/25/17
to testng-users
Hi,

In my case, I didn't declare dependsOnGroups in the @Test as you as below:

@Test(dependsOnGroups=preSetup2, groups=preSetup3)


My way is declare only group in the @Test, then in the TestNGTestSuite.xml, I define the group dependency


Class Preconfig1.java

package TestLab.Interagtion.UploadPayment;

import Libs.Utils.*;
import FrameWork.*;

@Test(groups = {"PreConfig_1"})
public class PreConfig_1
{
    @Test(alwaysRun = false)
public void PreConfig_1() throws Exception
{
        Code....
    }
}

Class Upload01.java

package TestLab.Interagtion.UploadPayment;

import Libs.Utils.*;
import FrameWork.*;


@Test(groups = {"Upload01"})
public class Upload01
{
    @Test(alwaysRun = false)
public void Upload01() throws Exception
{
        Code....
    }
}



Class Upload02.java


package TestLab.Interagtion.UploadPayment;

import Libs.Utils.*;
import FrameWork.*;

@Test(groups = {"Upload02"})
public class Upload02
{
    @Test(alwaysRun = false)
    public void Upload01() throws Exception
{
        Code....
    }
}

TestNG TestSuite

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="UploadPayment" verbose="10">
<test name="Test_1">
<groups>
<dependencies>
<group name="Upload01" depends-on="PreConfig_1" />
<group name="Upload02" depends-on="PreConfig_1" />
</dependencies>
</groups>
<classes>
<class name="TestLab.Interagtion.UploadPayment.PreConfig_1" />
<class name="TestLab.Interagtion.UploadPayment.Upload01" />
<class name="TestLab.Interagtion.UploadPayment.Upload02" />
</classes>
</test>
</suite>


If @Test PreConfig_1 failed --> skip running @Test Upload01 and @Test Upload02


Hope it help,




Vào 09:32:10 UTC+7 Thứ Năm, ngày 25 tháng 5 năm 2017, Settaluri Karthik Sriharsha đã viết:

Settaluri Karthik Sriharsha

unread,
May 25, 2017, 6:37:35 AM5/25/17
to testng-users
Hoang Nguyen , 

Thanks for your wonderful response. I'm currently modifying the test annotations at class level instead of method level and trying out the same. 

I've one qq here though.

Lets say if "preConfig" has "10 tests" to run of which I need only say "first 4" and proceed with second classes test methods there after. How do i achieve that ?

Krishnan Mahadevan

unread,
May 25, 2017, 11:00:03 AM5/25/17
to testng...@googlegroups.com

Karthik,

 

I am not able to reproduce your issue. FWIW I am running on TestNG 6.11

 

Here’s what I have:

 

UntilLogin.java

 

public class UntilLogin {
   
@Test(groups = "preSetup1")
   
public void test_setup1() {
        System.
out.println("test_setup1");
    }

   
@Test(dependsOnGroups = "preSetup1", groups = "preSetup2")
   
public void test_setup2() {
        System.
out.println("test_setup2");
    }

   
@Test(dependsOnGroups = "preSetup2", groups = "preSetup3")
   
public void test_setup3() {
        System.
out.println("test_setup3");
    }

   
@Test(dependsOnGroups = "preSetup3", groups = "preSetup4")
   
public void test_setup4() {
        System.
out.println("test_setup4");
    }

   
@Test(dependsOnGroups = "preSetup4", groups = "preSetup5")
   
public void test_setup5() {
        System.
out.println("test_setup5");
    }

   
@Test(dependsOnGroups = "preSetup5", groups = "homePage")
   
public void test_homePage() {
        System.
out.println("test_homePage");
    }

}

 

PostLogin.java

 

public class PostLogin {
   
@Test(dependsOnGroups="homePage", groups="postgroup")
   
public void test_postLogin() {
        System.
out.println("test_postLogin");
    }
}

 

Here’s my suite xml file

 

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="Suite" parallel="none">


    <
test name="Login_ClickLists_SelectListSelectItemAndOrderTest" verbose="3">
        <
classes>
            <
class name="com.rationaleemotions.testng.UntilLogin">
                <
methods>
                    <
include name="test_setup1"/>
                    <
include name="test_setup2"/>
                    <
include name="test_setup3"/>
                    <
include name="test_setup4"/>
                    <
include name="test_setup5"/>
                    <
include name="test_homePage"/>
                </
methods>
            </
class>
            <
class name="com.rationaleemotions.testng.PostLogin">


                <
methods>
                    <
include name="test_postLogin"/>
                </
methods>
            </
class>
        </
classes>
    </
test>


</
suite>

 

Here’s the output:

 

[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ testbed ---

 

-------------------------------------------------------

T E S T S

-------------------------------------------------------

Running TestSuite

test_setup1

test_setup2

test_setup3

test_setup4

test_setup5

test_homePage

test_postLogin

===== Invoked methods

    UntilLogin.test_setup1()[pri:0, instance:com.rationaleemotions.testng.UntilLogin@36f6e879] 922151033

    UntilLogin.test_setup2()[pri:0, instance:com.rationaleemotions.testng.UntilLogin@36f6e879] 922151033

    UntilLogin.test_setup3()[pri:0, instance:com.rationaleemotions.testng.UntilLogin@36f6e879] 922151033

    UntilLogin.test_setup4()[pri:0, instance:com.rationaleemotions.testng.UntilLogin@36f6e879] 922151033

    UntilLogin.test_setup5()[pri:0, instance:com.rationaleemotions.testng.UntilLogin@36f6e879] 922151033

    UntilLogin.test_homePage()[pri:0, instance:com.rationaleemotions.testng.UntilLogin@36f6e879] 922151033

    PostLogin.test_postLogin()[pri:0, instance:com.rationaleemotions.testng.PostLogin@735b478] 120960120

=====

PASSED: test_setup1

PASSED: test_setup2

PASSED: test_setup3

PASSED: test_setup4

PASSED: test_setup5

PASSED: test_homePage

PASSED: test_postLogin

 

===============================================

    Login_ClickLists_SelectListSelectItemAndOrderTest

    Tests run: 7, Failures: 0, Skips: 0

===============================================

 

Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 15.323 sec - in TestSuite

 

Results :

 

Tests run: 7, Failures: 0, Errors: 0, Skipped: 0

 

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESS

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 19.565 s

[INFO] Finished at: 2017-05-25T20:21:44+05:30

[INFO] Final Memory: 28M/318M

[INFO] ------------------------------------------------------------------------

 

 

 

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

--

Reply all
Reply to author
Forward
0 new messages