title: if else condition on Assert.assertEquals selenium testNG
body: <p>I am working on selenium and testNG with java.. I have some problem about this code:</p>
  
  <pre><code>Assert.assertEquals(webDriver.getCurrentUrl(), "http://google.com");
  </code></pre>
  
  <p>the question is how to create if else condition in assertEquals. like this</p>
  
  <pre><code>if( Assert.assertEquals(webDriver.getCurrentUrl(), "http://google.com"));
  {
      //do Nothing
  }
  
  else
  {
     // take screenshoot
  }
  </code></pre>
  
  <p>any idea guys?</p>