Skip to content

Instantly share code, notes, and snippets.

@Bakhyt1987
Created December 23, 2019 09:24
Show Gist options
  • Save Bakhyt1987/2e6f1c739d8460068099ec7e8f9bae18 to your computer and use it in GitHub Desktop.
Save Bakhyt1987/2e6f1c739d8460068099ec7e8f9bae18 to your computer and use it in GitHub Desktop.
package iosdemo;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
public class FirstIOSTest {
public static void main(String[] args) throws MalformedURLException {
firstTest();
}
AppiumDriver<MobileElement> driver;
public static void firstTest() throws MalformedURLException {
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("platformName", "iOS");
cap.setCapability("platformVersion", "13.1");
cap.setCapability("deviceName", "iPhone 8");
cap.setCapability(CapabilityType.BROWSER_NAME, "safari");
//cap.setCapability("app", “location of .app or .ipa file“);
URL url = new URL("http://127.0.0.1:4723/wd/hub");
IOSDriver driver = new IOSDriver(url, cap);
driver = (IOSDriver) new AppiumDriver<MobileElement>(url, cap);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment