factory annotation in testng
The @Factory annotation is useful when we want to run multiple test
cases through a single test class. It is mainly used for the dynamic
execution of test cases.
Let's say we have in 2 different classes, there are 2 different test cases.
If we want to run both in the same class. We use @Factory annotaions which
takes Object[] array. We put the test cases into it. it returns Object array
value.