Created
December 23, 2019 09:24
-
-
Save Bakhyt1987/2e6f1c739d8460068099ec7e8f9bae18 to your computer and use it in GitHub Desktop.
This file contains 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
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