1

I am new to testing, and I am trying to understand the basics.

I have some questions listed below.

  1. Are Selenium and TestNG the same?
  2. If they are different than how?
  3. What are Selenium, Webdriver, and TestNG, and why are they used? I don't understand the difference between these tools
4

First, talk a look at this question. The answers cover the difference between Selenium and TestNG fairly well.

A very basic explanation for you:

  • Selenium is an API (application programming interface) to interact with web pages. It defines objects and methods to interact with different browsers.
  • Webdriver or Selenium Webdriver is one of the two main flavors of Selenium (the other is the Selenium IDE, which is no longer in development). Webdriver is exactly what it says: a way to drive web applications/web pages using the Selenium objects and methods.
  • TestNG is one of the many testing frameworks that use Selenium Webdriver and add wrappers and reporting. Which framework you choose depends on your language preferences and how well the framework supports the application/web site you are testing.
1

1) Are Selenium and TestNG the same?

TestNG is a framework that will help you organize your tests ex: prioritizing, retrying, reporting, etc. Selenium cannot do this.

Selenium gives you a WebDriver API through which you can identify and act on certain elements on your Web application. It cannot generate reports or tabulate and organize results, retry a test case, etc. So it has to use a framework and TestNG comes into the picture.

2)If they are different than how?

May be clear as defined above.

3)What are Selenium, Webdriver, and TestNG, and why are they used? I don't understand the difference between these tools

WebDriver is a web automation framework that uses Junit.

TestNG 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

in WebDriver For running the failed test cases, we need to run the whole script again. Failed test cases can be run separately using TestNG.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.