How to force TestNG create new instance of test class for each method if run mode is parallel=“methods”

前端 未结 3 629
暖寄归人
暖寄归人 2021-01-01 19:26

How to force TestNG create new instance of test class for each method if run mode is parallel=\"methods\"?

JUnit does it automatically but TestNG reuses

3条回答
  •  无人及你
    2021-01-01 20:13

    Checkout Factory

    From javadoc:

    Marks a method as a factory that returns objects that will be used by TestNG as Test classes. The method must return Object[].
    

提交回复
热议问题