java - TestNG reporter not logging for exceptions -


hey guys trying customize output of selenium framework using testng. right have 'action' class wrapping selenium methods , wraping in try catches. here's example. (i manually throwing exception testing purposes.)

public void closebrowser(){     try{         driver.quit();         throw new webdriverexception();     }     catch(exception e){         exceptionhandler exception = new exceptionhandler(e, null);     } } 

my exception handler class looks this:

public exceptionhandler(exception exceptionname, string element){         this.exceptionname = exceptionname;         this.element = element;         report(); }  public void report(){      string delims = "[.]";     string[] tokens = exceptionname.getclass().tostring().split(delims);     system.out.println(tokens[tokens.length-1]);      switch(tokens[tokens.length-1]){         case "webdriverexception":             system.out.println("made case 1");             reporter.log("test message here <------ \n", true);             break;         default:             reporter.log("unknown exception");       }  } 

when run output on console:

webdriverexception made case 1 test message here <------  

but never in html files testng generates. ideas??


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -