Need of TestNG or Junit framework in Webdriver to run the tests?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Need of TestNG or Junit framework in Webdriver to run the tests?

vinodguneja
Hi folks,

Is there any need of test framework like TestNG or junit in web driver to run the tests.I have asked that question because when i install testNG into eclipse then it is not installed because it given a some error then i run the test without test framework.

This is my test Script which i run without Test framework.I have included all the jars.


package com.example2.tests;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class WebDriverTest {

    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
       driver.get("http://www.google.com");
        WebElement element = driver.findElement(By.name("q"));
        element.sendKeys("CRICKET");
        element.submit();
   }

}

Thanks!
Vinod
Reply | Threaded
Open this post in threaded view
|

Re: Need of TestNG or Junit framework in Webdriver to run the tests?

softwaretestingforum
Administrator
Think of it this way. Would you be writing all your test scenarios in one method? How are you going to maintain one big method when there are changes?
~ seleniumtests.com