Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Created June 21, 2014 11:51
Show Gist options
  • Save prashanth-sams/8394e27297676128975e to your computer and use it in GitHub Desktop.
Save prashanth-sams/8394e27297676128975e to your computer and use it in GitHub Desktop.
package pack;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import java.net.URL;
import java.util.concurrent.TimeUnit;
public class Webappios {
public WebDriver driver = null;
private String baseUrl;
@BeforeMethod
public void setUp() throws Exception{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "Safari");
capabilities.setCapability(CapabilityType.PLATFORM, "ios");
capabilities.setCapability(CapabilityType.VERSION, "6.1");
capabilities.setCapability("deviceName", "iPhone Simulator");
baseUrl = "https://in.yahoo.com";
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4725/wd/hub"), capabilities);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@AfterMethod
public void tearDown() throws Exception {
driver.quit();
}
@Test
public void test01() throws InterruptedException {
driver.get(baseUrl + "/");
driver.findElement(By.id("p")).sendKeys("prashanth sams");
Thread.sleep(3000);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment