Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public static void main(String[] args)
{
IOSDriver driver = null;
try
{
final DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "TTND iPhone6 Plus");
capabilities.setCapability("browserName", "");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability(CapabilityType.VERSION, "9.3.3");
capabilities.setCapability("appium-version", "1.4.13");
capabilities.setCapability("app","/Users/intelligrapesoftware/Downloads/dotrips.ipa");
capabilities.setCapability("udid", "c6451df23fef13665aa479c7dff9733bb7f84cfd");
driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
Thread.sleep(20000);
captureImage(driver);
Set<String> contextNames = driver.getContextHandles();
for (String contextName : contextNames) {
System.out.println(contextName); //prints out something like NATIVE_APP \n WEBVIEW_1
}
driver.context(contextNames.toArray()[1].toString());
driver.findElement(By.name("userName")).sendKeys("pocuser");
Thread.sleep(1000);
driver.findElement(By.name("password")).sendKeys("pocuser");
Thread.sleep(2000);
driver.findElement(By.cssSelector("div.btn-section >div")).click();
Thread.sleep(2000);
driver.findElement(By.xpath("//span[contains(text(),'Continue')]")).click();
Thread.sleep(2000);
driver.findElement(By.cssSelector("div.login-button#km-button")).click();
Thread.sleep(2000);
driver.findElement(By.xpath("//div[@class='login-button*km-button']")).click();
Thread.sleep(2000);
}
catch(Exception e)
{
e.printStackTrace();
}
driver.quit();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment