Monday 17 December 2012

Selenium TestNG


import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
import com.thoughtworks.selenium.DefaultSelenium;
public class testNgTest {
public static DefaultSelenium selenium;
 @Test
 public void verifyMaillogin() throws Exception{
              selenium.open("/");
            selenium.windowMaximize();
            selenium.type("id=f_id", "may397");
            selenium.type("id=f_pwd", "selenium");
            selenium.click("css=input.signin");
                        Thread.sleep(7000);
                        System.out.println("Hiiii");
                        selenium.click("link=Sign out");
 }
 @BeforeTest
  public void beforeTest() {
  selenium=new DefaultSelenium("localhost",4444,"*firefox","http://mail.in.com");
  selenium.start();
 }
 @AfterTest
  public void afterTest() {
  //selenium.stop();
 }
}

No comments:

Post a Comment