package seleniumTestNG;
import org.testng.annotations.Test;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
public class TestNG_H_Include_Exclude_Test_Methods {
WebDriver driver;
@Test
public void facebook() {
driver.get("http://www.fb.com");
}
@Test
public void twitter() {
driver.get("http://www.twitter.com");
}
@Test
public void google() {
driver.get("http://www.google.com");
}
@Test
public void linkedin() {
driver.get("http://www.linkedin.com");
}
@Test
public void seleniumlearn() {
driver.get("http://www.seleniumlearn.com");
}
@BeforeTest
public void beforeTest() {
driver=new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(9, TimeUnit.SECONDS);
}
@AfterTest
public void afterTest() {
}
}
//==========================================================================//
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite">
<test name="Test">
<classes>
<class name="seleniumTestNG.TestNG_H_Include_Exclude_Test_Methods"/>
<methods>
<include name="linkdin"/>
<exclude name="facebook"/>
<exclude name="twitter"/>
<exclude name="google"/>
</methods>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
Comments