java - How to share state between test classes in a suite with TestNG and Maven? -


i have java test framework set using testng , maven. tests organized suites via testng xml files.

i share state between different test classes in same suite. specifically, want share id 'test plan' created in testrail test case manager @ start of test suite execution.

how that? testng doesn't seem offer functionality transferring information between test classes, , i'm unsure of how @ maven level either. static variable in parent class work, or leak or cause many thread-safety issues?

update: have decided solve problem using static variable in parent class (which holds various state tests running). use case, i'm not run multiple instances of parent class concurrently in same jvm in way needs static variable threadsafe.

however, still open other ideas on how accomplish this, because enjoy learning new things.

i think can use beforemethod annotation , put stuff desired state before each test execution. more "state sharing" not desired.


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -