Quantcast
Channel: Pochampalli IT Labs
Viewing all articles
Browse latest Browse all 261

java.lang.AssertionError

$
0
0

  • TestNG Assert.assertEquals compares the two strings 
  • This is one of situvations we get java.lang.AssertionError when the strings are not equal
  • For instance, 

String expectedEditProductURL ="http://sadakar.website.lab/Product?productId=89";
String actualEditProductURL = driver.getCurrentUrl();
Assert.assertEquals(actualEditProductURL, expectedEditProductURL);

java.lang.AssertionError:http://sadakar.website.lab/Product?productId=89 expected [http://sadakar.website.lab/Product?productId=899] but found [Change Product details hyperlink clicking is failed]
at org.testng.Assert.fail(Assert.java:97)
at org.testng.Assert.assertEqualsImpl(Assert.java:136)
at org.testng.Assert.assertEquals(Assert.java:118)
at org.testng.Assert.assertEquals(Assert.java:575)




Viewing all articles
Browse latest Browse all 261

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>