Reputation: 23
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.
Upvotes: 1
Views: 7069
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
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