java - TestNG global @AfterMethod -


in java testng possible somehow specify global (or suite wide) method @aftermethod annotation? goal have different test cases in separate classes(so 1 file = 1 test) have common @aftermethod without duplicating method in every class.

you can achieve making superclass. example:

public class basictestscenario {    @aftermethod(alwaysrun=true)   public void teardown() {     // implementation   } } 

then have tests inherit class.

public class mytest extends basictestscenario { // test } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -