Posts

Annotations of testng

Image
Prioritising in testng Grouping in testng @BeforeTest -- executes the method once for all classes @BeforeClass-- executes the method once per class before test method @BeforeMethod-- executes the method inside a class everytime before every test method

assertions in testing soft and hard assertions

Image
https://www.softwaretestingmaterial.com/soft-assert/ One of the advantage of using testing is to make use of it for assertions.  AssertTrue and AssertEquals are commonly used methods. Soft Assertion will not stop execution but hard Assertion does. How to use them is mentioned below.

Steps to create TestNG xml and run test using the same

Image
Source:  https://www.softwaretestinghelp.com/testng-example-to-create-testng-xml/ What Is TestNG.Xml? TestNG.xml file is a configuration file that helps in organizing our tests. It allows testers to create and handle multiple test classes, define test suites and tests. It makes a tester's job easier by controlling the execution of tests by putting all the test cases together and run it under one XML file. This is a beautiful concept, without which, it is difficult to work in TestNG. Main things in TestNG xml: Concepts Used In TestNG.xml #1)  A Suite is represented by one XML file. It can contain one or more tests and is defined by the <suite> tag. Example:   <suite name =”Testing Google Apps”> #2)  A Test is represented by <test> and can contain one or more TestNG classes. Example:   <test name =”Regression”> #3)  A Class is a Java class that contains TestNG annotations. Here it is represented by the < class...