我想在真正的iOS设备上通过wifi(不通过电缆连接)执行我的appium测试用例。
我尝试了“设备和模拟器”中的“通过网络连接”选项。但是它只是启动应用程序并自动关闭。测试用例未执行。同一测试用例通过电缆正确执行(如果密码已关闭)。 xCode版本= 10.1 设备iOS版本= 12.4.2
@BeforeTest
public void applaunch() throws MalformedURLException {
dc.setCapability("platformName", "iOS");
dc.setCapability("deviceName", "My iPhone");
dc.setCapability("automationName", "XCUITest");
dc.setCapability("noReset", true);
dc.setCapability("xcodeOrgId", "HDYDHGKBDKGJG");
dc.setCapability("xcodeSigningId", "iPhone Developer");
dc.setCapability("platformVersion", "12.4.2");
dc.setCapability("useNewWDA", "true");
//dc.setCapability("reportDirectory", reportDirectory);
//dc.setCapability("reportFormat", reportFormat);
dc.setCapability("testName", testName);
dc.setCapability(MobileCapabilityType.UDID, "Vhduysshs9af42cad204240fdfgfdgdgyjdhdhgdf");
dc.setCapability("bundleId", "com.estapp.pro.apptest");
driver = new IOSDriver<IOSElement>(new URL("http://127.0.0.1:4723/wd/hub"), dc);
}
@Test
public void test() throws Exception{
driver.findElementByXPath("//*[@name='More']").click();// Click on More button
}
@AfterTest
public void CloseApp() {
driver.closeApp();
}