java - Dynamically skip particular tests in testng -


i'm trying skip particular tests based on condition using annotation transformers http://testng.org/doc/documentation-main.html#annotationtransformers

here class

public class mydisabledtest implements iannotationtransformer {       @test(enabled=false)     public void testdisabled() {         system.out.println("this disabled test");     }      @override     public void transform(itestannotation annotation, class testclass,             constructor testconstructor, method testmethod) {         // todo auto-generated method stub         if ("testdisabled".equals(testmethod.getname())) {             annotation.setenabled(true);         }     } } 

here's xml

<suite name="mytestngsuite" parallel="methods"     data-provider-thread-count="3" thread-count="3">   <listeners>     <listener class-name="com.walmart.gls.demo_package.mydisabledtest"/>   </listeners>   <test name="mytestngtest">     <classes>       <class name="mydisabledtest">         <methods>           <include name="testdisabled" />         </methods>       </class>     </classes>   </test> </suite> 

i'm trying enable test has been disabled @ compile time. getting wrong here? i'm not getting printed on console.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -