TestNG is an open-source test automation framework for Java. It is developed on the same lines as JUnit and NUnit. A few advanced and useful features provided by TestNG make it a more robust framework compared to its peers. The NG in TestNG stands for ‘Next Generation.’ Created by Cedric Beust, it is used more frequently by developers and testers in test case creation, owing to its ease of using multiple annotations, grouping, dependence, prioritization, and parametrization features.
One of the drawbacks of Selenium is that it does not have a proper format for the test results. By using TestNG framework in Selenium, Tester can:
- Generate the report in a proper format.
- Include the number of test cases run; tests passed, failed, and skipped in the report.
- Group test cases by converting them to testing.xml
- Use invocation count and execute multiple tests without using loops
- Perform cross browser testing
- Easily understand annotations
- Java
- Selenium
- TestNG
- Allure
- Faker Library
-
Login to orange hrm demo site https://opensource-demo.orangehrmlive.com/
-
Create 2 new employees and save it to a JSON list
-
Now go to PIM dashboard and search by 1st user name. Assert that the user is found.
-
Now click on the user from the search table and update id by random userid
-
Now again search the user by new user id from the PIM dashboard menu and assert that the user is found
-
Now logout from admin and login with the 2nd user from your JSON list
-
Now click on My Info menu
-
Select Gender and Blood Type and save it
-
Click on contact details and input address and email
-
Logout the user
Java needs to be installed in device
-
Clone the repo
-
Open cmd in the root folder
-
Give following commands:
gradle clean test allure generate allure-results --clean -o allure-report allure serve allure-results