Answers for "Assertions in selenium"

0

Assertions in selenium

ASSERTIONS: 
Assertions are coming from TestNG
Assertions allows us to do our verification 
between actual and expected results
*Assert.assertEquals(actual, expected);
assertEquals :
This method expected two arguments to be passed: actual, expected. 
It compares these two values and if they are exact 
Assert.assertEquals("title", driver.getTitle()); 
*assertTrue :returning boolean values: isSelected, isDisplayed, 
isEmpty, contains, equals, startsWith etc... 
*assertFalse
Assert.fail() 
is just another static assertion method. 
Where ever you call this method, it will directly FAIL the test.
Posted by: Guest on May-16-2021

Browse Popular Code Answers by Language