Is there a way I can use Data Provider for only part of the code but not for the entire class?
For example, if I want to do
1. Function A - Login
2. Function B - X (with 5 rows in the data sheet excel and I'd like this function to repeat for 5 times)
How do I run login only once? I tried the following but funcA (login) still runs for multiple times.
class X{
funcA (@Test)
funcB (@Test(dataProvider))
}
If there is only one test method in your class X use @BeforeClass annotation on funcA since it executes before the first test method in the current class (in this case that would be funcB test method). For more info about @BeforeClass and other before annotations you can check out this site.