October 25, 2010

First TestNG script

Hi...


Hear is the first TestNG scrit....


package test;

import com.thoughtworks.selenium.*;

import org.openqa.selenium.server.*;
import org.testng.annotations.*;


public class DefaultTNG {
public Selenium selenium;
public SeleniumServer seleniumserver;

@BeforeClass
public void setUp() throws Exception {
RemoteControlConfiguration rc = new RemoteControlConfiguration();
seleniumserver = new SeleniumServer(rc);
selenium = new DefaultSelenium("localhost", 4444, "*iexplore", "http://");
seleniumserver.start();
selenium.start();
}

@Test
public void testDefaultTNG()throws Exception {

selenium.open("http://www.yahoo.com");
selenium.windowMaximize();
selenium.open("http://www.google.com");
selenium.type("q", "Selenium OpenQA");
selenium.click("btnG");
Thread.sleep(10000);
}
@AfterClass
public void tearDown()throws Exception {
selenium.stop();
seleniumserver.stop();

}
}

1 comment:

  1. The post and training of naga sir is excellent..realy the first person am seeing even in such a great position,will response whenever we pings him,and during training ..really great job sir doing during training session and the post we seeing here
    regards.,
    Babu.m

    ReplyDelete