Shaq
Shaq

Reputation: 23

which is not annotated with @Test or not included

I created two classes under the same package one is called preparation the other is X when I use dependsOnMethods to point to the test case in Preparation I get an exception.

class X.

    @Test(enabled = true,  dependsOnMethods = {"com.selenium.scripts.passkey.regression.delegateprofile.Preparations.TC_01"})
        public void TC_01() {
      something ...
    }

class preparation :

    @Test(enabled = true, description = "Preparation: create a new hotel.")
        public void TC_01() {........}

Here is the error:

com.selenium.scripts.passkey.regression.delegateprofile.DProfile.TC_01() is depending on method public void com.selenium.scripts.passkey.regression.delegateprofile.Preparations.TC_02(), which is not annotated with @Test or not included.

Please see attached image...

Upvotes: 1

Views: 7069

Answers (3)

Ankit Tripathi
Ankit Tripathi

Reputation: 11

The method should be included in the .xml file

Upvotes: 1

juherr
juherr

Reputation: 5740

As I know, dependsOnMethods only accept method name and not a class + name.

What you can try to do is using groups and dependsOnGroups attribute.

Upvotes: 0

Ashwin Pajankar
Ashwin Pajankar

Reputation: 115

The method on which your test methods depends on should also be in the same class than different classes. This will not make the code ambiguous.

Upvotes: 0

Related Questions