package sample;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.safari.SafariDriver;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class Safari_Test {
public WebDriver driver;
@Test
public void testSafari_Test() throws Exception {
driver.get("http://www.yelp.com/san-jose");
driver.findElement(By.className("pseudo-input_text")).click();
driver.findElement(By.xpath("//li[@data-suggestion=\'Restaurants\']/strong")).click();
driver.findElement(By.id("header-search-submit")).click();
driver.findElement(By.id("find_desc")).sendKeys(" Pizza");
driver.findElement(By.id("header-search-submit")).click();
Thread.sleep(2000);
}
@BeforeClass
public void beforeClass() {
//launch safari browser
driver = new SafariDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
}
@AfterClass
public void afterClass() throws Exception {
driver.quit();
}
}