Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 应用程序不是在装有Appium的iPad上启动的_Ios_Ipad_Appium - Fatal编程技术网

Ios 应用程序不是在装有Appium的iPad上启动的

Ios 应用程序不是在装有Appium的iPad上启动的,ios,ipad,appium,Ios,Ipad,Appium,我对Appium和iOS都是新手,无法在iPad上使用Appium启动我的应用程序 我正在尝试启动一个已经安装在iPad上的应用程序,然后单击该应用程序中的按钮。当我运行此测试时,没有任何应用程序启动,也不确定我缺少了什么 我的设置: iPad:10.2 附件:1.6 XCode:8.2.1 我只有一个用于测试的.ipa文件 这是我正在试用的代码。我假设我的安装版本需要XUITEST import java.net.MalformedURLException; import java.net

我对Appium和iOS都是新手,无法在iPad上使用Appium启动我的应用程序

我正在尝试启动一个已经安装在iPad上的应用程序,然后单击该应用程序中的按钮。当我运行此测试时,没有任何应用程序启动,也不确定我缺少了什么

我的设置:

  • iPad:10.2
  • 附件:1.6
  • XCode:8.2.1
  • 我只有一个用于测试的.ipa文件
这是我正在试用的代码。我假设我的安装版本需要XUITEST

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.junit.After;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.Test;
import io.appium.java_client.ios.IOSDriver;

public class iOSTest {

    @Test
    public void setUp() throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("deviceName", "My iPad");
        capabilities.setCapability("udid", "UID_CODE");
        capabilities.setCapability("platformVersioin", "10.2");
        capabilities.setCapability("bundleId", "com.bundle.id");
        capabilities.setCapability("app", "--ipa /Users/me/Desktop/MyIpaFile.ipa");
        capabilities.setCapability("automationName", "XCUITest");

        IOSDriver driver = new IOSDriver(new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
        driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);

    }

}
以下是我在Eclipse中运行时遇到的错误:

[TestNG] Running:
  /private/var/folders/1v/z4bcsphn11n38cs5hdnq7zkc7gwjdl/T/testng-eclipse-2119368657/testng-customsuite.xml

Jan 26, 2017 3:11:17 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Jan 26, 2017 3:11:18 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
Jan 26, 2017 3:11:18 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to straight W3C remote end connection
FAILED: setUp
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=--ipa /Users/me/Desktop/MyIpaFile.ipa, platformVersioin=10.2, bundleId=com.bundle.id, automationName=XCUITest, udid=UID_CODE, platformName=iOS, deviceName=My iPad}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:48:19 -0700'
System info: host: 'myMachine.local', ip: '10.45.4.216', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.6', java.version: '1.8.0_92'
Driver info: driver.version: IOSDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:36)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:114)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:132)
at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:82)
at POC.iOSTest.setUp(iOSTest.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
[TestNG]正在运行:
/private/var/folders/1v/z4bcsphn11n38cs5hdnq7zkc7gwjdl/T/testng-eclipse-2119368657/testng-customsuite.xml
2017年1月26日下午3:11:17 org.openqa.selenium.remote.ProtocolHandshake createSession
信息:正在尝试双方言会话,假设远程端的Postel定律成立
2017年1月26日下午3:11:18 org.openqa.selenium.remote.ProtocolHandshake createSession
信息:回到原来的OSS JSON Wire协议。
2017年1月26日下午3:11:18 org.openqa.selenium.remote.ProtocolHandshake createSession
信息:退回到直接的W3C远程端连接
失败:安装
org.openqa.selenium.SessionNotCreatedException:无法创建新的远程会话。所需功能=功能[{app=--ipa/Users/me/Desktop/MyIpaFile.ipa,platformversion=10.2,bundleId=com.bundle.id,automationName=xguitest,udid=UID\u CODE,platformName=iOS,deviceName=My iPad}],所需功能=功能[{}]
构建信息:版本:'3.0.1',修订版:'1969d75',时间:'2016-10-18 09:48:19-0700'
系统信息:主机:'myMachine.local',ip:'10.45.4.216',os.name:'Mac os X',os.arch:'x86_64',os.version:'10.11.6',java.version:'1.8.0_92'
驱动程序信息:Driver.version:IOSDriver
位于org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
位于org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
在io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
位于org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
在io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
在io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
位于io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
位于org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
位于org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:128)
位于org.openqa.selenium.remote.RemoteWebDriver。(RemoteWebDriver.java:141)
位于io.appium.java_client.DefaultGenericMobileDriver。(DefaultGenericMobileDriver.java:36)
位于io.appium.java_client.AppiumDriver。(AppiumDriver.java:114)
位于io.appium.java_client.AppiumDriver。(AppiumDriver.java:132)
位于io.appium.java_client.ios.IOSDriver.(IOSDriver.java:82)
位于POC.iOSTest.setUp(iOSTest.java:24)
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处
位于sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)中
位于java.lang.reflect.Method.invoke(Method.java:498)
位于org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
位于org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
位于org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
位于org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
位于org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
位于org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
位于org.testng.TestRunner.privateRun(TestRunner.java:756)
位于org.testng.TestRunner.run(TestRunner.java:610)
位于org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
在org.testng.SuiteRunner.runSequential上(SuiteRunner.java:382)
位于org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
运行(SuiteRunner.java:289)
位于org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
位于org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
在org.testng.testng.runSuitesSequentially上(testng.java:1293)
位于org.testng.testng.runSuitesLocally(testng.java:1218)
位于org.testng.testng.runSuites(testng.java:1133)
运行(testng.java:1104)
位于org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
位于org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
位于org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

你能发布appium给你的错误吗?@econoMichael,我已经简化了代码以帮助指出我的问题,但我仍然不确定我缺少什么,或者
所需的功能应该如何组成