Java 怎么使用模拟器中的Appium Safari

2019年7月29日19:56:57Java 怎么使用模拟器中的Appium Safari已关闭评论 371 1154字阅读3分50秒

1.简介

Java 怎么使用模拟器中的Appium Safari?——请看下文。

2.示例代码

/**
 * 版权所有 编程十万个怎么办(www.tah1986.com)
 */

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.ios.IOSDriver;
import io.appium.java_client.remote.MobileCapabilityType;
import io.appium.java_client.remote.MobilePlatform;

public class IOSSafariSimulatorTest {
    

    public static void main(String[] args) throws MalformedURLException,
            InterruptedException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,
                "Appium");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,
                MobilePlatform.IOS);
        capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION,
                "9.1");
        
        capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,
                "iPhone Simulator");
        capabilities
                .setCapability(
                        MobileCapabilityType.APP,
                        "/Users/administrator/Library/Developer/Xcode/DerivedData/UICatalog-etygmeejalybcbeaczwvsdflvftm/Build/Products/Debug-iphoneos/UICatalog.app");
        

        IOSDriver driver = new IOSDriver(new URL(
                "http:
        driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
        
        
        
    }
}

 
继续阅读
编程十万个怎么办