Online Batch 2 Day 4 TestNG Assertion

Опубликовано: 06 Февраль 2025
на канале: Vikas Thange
826
8

TestNG
Assert
Assert.fail()//To intentionally fail test case

Assert.assertEquals(actual,expected); // if both not equal then fail test
Assert.assertTrue(condition) // if condition if false then fail the test
Assert.notNull(obj); // if object is null then fail test case

Assert.assertNotEquals(actual,expected); // if both equal then fail test
Assert.assertFalse(condition) // condition must be false. if it is true then fail test

Assert.assertNull(obj) // object must be null else fail