Created
August 12, 2016 19:29
-
-
Save kkashyap1707/7e1d11469e76322b686c02037accd88c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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