I am looking at one of the question that is posted long back by x person.
Ex: assertEquals(driver.getPageSource().contains("sometext"), true);
(or) assertEquals(boolean , boolean);
If the above method exists I love to use it. I looked around JUnit API and its methods and there is no such method .
1) If it exists can someone post the relevant link, please ?
2) do assertations exist in JAVA default classes? (I know they are there in JUNIT)
Why not use assertTrue(driver.getPageSource().contains("sometext"));?
The assertEquals methods are in JUnit, specifically in the org.junit.Assert class:
You typically import them with a static import statement like this:
import static org.junit.Assert.*;
assert on its own is part of core Java, it provides a way to add sanity checks that get run while you are debugging, but which get ignored (and therefore don't add any overhead) in production code.
assert(something==somethingElse);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With