selenium webdriver - Where the assert message will be displayed -


i tried code

package base;  import org.testng.assert; import org.testng.annotations.test;  public class assertcheck  {     @test     public void check() {         assert.asserttrue(true, "testing string true");     } } 

and code succeeds message "testing string true" not displayed. checked in console output , in testng results.

just information, message parameter executed if assert condition false. message appear in console.

but in case assert condition passed, message part not executed, not see message in case.

if want see message in both cases, should use try-catch statement like

try{      assert.asserttrue(true, "testing string true");      //print message case assert pass and/or perform other event }catch (exception e){      //print message case assert fails and/or perform other event      loggerobj.debug("assert failed "+e.getmessage()); } 

Comments

Popular posts from this blog

c - sscanf() double showing zeros -

pentaho - Carte Status / Kettle Slave Server Status page shows status for random runs instead of the latest run -