If you include in the setUp() method code that opens the site, for example,
@BeforeTest
public void setUp() {
System.setProperty("webdriver.chrome.driver",
"c:/selenium/chromedriver.exe");
driver = new ChromeDriver();
driver.get(URL);
searchForKeyword(keyword);
}
all test methods will have to start with opening the home page and running a keyword search.
If one of the tests will prefer to start on a diferent page, this will not be possible.
It is better to just set up the environment in the setUp() method and move all code that interacts with the site in each test method:
@BeforeTest
public void setUp() {
System.setProperty("webdriver.chrome.driver",
"c:/selenium/chromedriver.exe");
driver = new ChromeDriver();
}