1.DesiredCapabilities的配置
DesiredCapabilitiescapabilities=newDesiredCapabilities();
capabilities.setCapability("deviceName","iPad");
capabilities.setCapability("platformVersion","12.0");
capabilities.setCapability("platformName","iOS");
capabilities.setCapability("udid", "");
capabilities.setCapability("browserName","Safari");
// capabilities.setCapability("unicodeKeyboard","true");
// capabilities.setCapability("resetKeyboard","true");
2.直接运行appium会提示【No web frames found. [XCUITest] Error: Could not navigate to webview】
参考://www.greatytc.com/p/903352ed724c
1.下载 ios_webkit_debug_proxy
brew install ios-webkit-debug-proxy
2.启动 ios_webkit_debug_proxy
ios_webkit_debug_proxy
3.启动appium
node /Applications/Appium.app/Contents/Resources/app/node_modules/appium/build/lib/main.js --webkit-debug-proxy-port 9222 -p 4723
4.元素定位
启动Safari,地址栏输入 http://localhost:9222
选择自己的设备,然后在设备上打开safari