You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having more than one methods in a class with same name and different signature (method overloading) and selecting (by double clicking the method name) and running one test method, it should run the selected method alone.
Actual behavior
It executes all the methods with that name.
Is the issue reproductible on runner?
Eclipse
Test case sample
importorg.testng.ITestContext;
importorg.testng.annotations.DataProvider;
importorg.testng.annotations.Test;
publicclassTestNGIssue {
@Testpublicvoidtest() {
System.out.println("test without param");
}
@Testpublicvoidtest(ITestContextcontext) {
System.out.println("test with param as itestcontext");
}
@Test(dataProvider = "data")
publicvoidtest(Stringname) {
System.out.println("test with param as string");
}
@DataProvider(name = "data")
publicObject[][] dataprovider() {
returnnewObject[][] { { "name" } };
}
}
The text was updated successfully, but these errors were encountered:
@Prakash-Saravanan - I think that's the expected behaviour. TestNG resorts to reflection to find methods, but it doesn't differentiate methods based on their signatures, but resorts to finding methods based on ONLY names. So IMO this is not an issue but TestNG is working as designed.
Prakash-Saravanan
changed the title
Issue in TestNG eclipse plugin on selecting overloaded test methods
Feature request: in TestNG eclipse plugin on selecting overloaded test methods
Dec 30, 2016
juherr
changed the title
Feature request: in TestNG eclipse plugin on selecting overloaded test methods
Feature request: selecting overloaded test methods (suite file and/or eclipse plugin)
Dec 30, 2016
TestNG Version
Expected behavior
Having more than one methods in a class with same name and different signature (method overloading) and selecting (by double clicking the method name) and running one test method, it should run the selected method alone.
Actual behavior
It executes all the methods with that name.
Is the issue reproductible on runner?
Test case sample
The text was updated successfully, but these errors were encountered: