Automating web apps in iOS automation using appium

Here is the example that shows how to automate web app on iOS device using Appium. Below code will launch safari in iPad and then open website. Note that Automating the web app on iOS device is similar to automating the website on desktop browser.
package iostests;

import io.appium.java_client.ios.IOSDriver;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;

import java.util.concurrent.TimeUnit;

 * Created by Sagar on 10-07-2016.
public class WebAppTest {
    IOSDriver driver;
    public void test1() throws Exception{
        DesiredCapabilities caps = new DesiredCapabilities();
        caps.setCapability("platformName", "iOS");
        caps.setCapability("platformVersion", "9.0");
        caps.setCapability("deviceName", "iPad pro");
        caps.setCapability(CapabilityType.BROWSER_NAME, "safari");
        driver = new IOSDriver(new URL(""), caps);
        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);


Web development and Automation testing

solutions delivered!!