What is the difference between selenium WebDriver and TestNG?


WebDriver is a web automation framework which allows us to execute test across various browsers. It also allows us to create the test scripts in any programming language we want. WebDriver makes direct calls to the browser using each browser’s native support for automation.

TestNG stands for Test Next Generation. It is an automation testing framework and uses annotations. Annotations are lines of code that control how the method below it will execute. The greatest advantage of TestNG is that we can generate test reports and know the number of scripts passed, failed or skipped. Failed test cases can be run separately using TestNG. Along with it TestNG provides enables us with the ability to execute the test cases by reading the input file from any medium like excel and generate reports in a different mediums.

WebDriverTestNG
WebDriver is a web automation framework that uses Junit.It is an automation testing framework and uses annotations such as @BeforeTest, @AfterTest which makes it more comprehensible.
WebDriver does not have a native mechanism for generating reports.Test Reports can be generated using TestNG
For running the failed test cases we need to run the whole script again.Failed test cases can be run separately using TestNG.

Updated on: 30-Jul-2019

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements