2017-06-16 11 views
0

IOS提供のサンプルアプリケーションでappiumでIOSを設定しようとしています。Appium IOS自動化 - エラー - Appium:エラーが発生しました-selenium.WebDriverException:リモート応答を解析できません:パラメータが正しくありません

私のコードを検索:

package test2; 

import java.io.File; 
import java.net.MalformedURLException; 
import java.net.URL; 

import org.junit.Test; 
import org.openqa.selenium.remote.DesiredCapabilities; 


import io.appium.java_client.AppiumDriver; 
import io.appium.java_client.ios.IOSDriver; 
import io.appium.java_client.ios.IOSElement; 

public class AppiumTestB { 

    private AppiumDriver<IOSElement> driver; 

    @Test 
    public void setup() throws MalformedURLException 
    { 

     DesiredCapabilities capabilities = new DesiredCapabilities(); 

      capabilities.setCapability("platformVersion", "9.0"); 
      capabilities.setCapability("deviceName", "iPhone 6"); 
      File app =new File("/Users/uwickdi/Desktop/UICatalog.app"); 
      capabilities.setCapability("app", app.getAbsolutePath()); 
      driver = new IOSDriver<>(new URL("http://127.0.0.1:4725/wd/hub"), capabilities); 

    } 

} 

IアップappiumサーバとJUnitを用いたテストを実行しました。 エラーログを確認してください。 私は何も見逃しましたか?

イムシミュレータ

org.openqa.selenium.WebDriverException使用してクライアントドライバ1.5.3(appium版) Javaクライアント4.1.2 を使用してリモート応答を解析できませんが:パラメータが間違っていました。 ["requiredCapabilities"、 "optionalCapabilities"、 "sessionId"、 "id"]}を送信しました。["desiredCapabilities"、 "requiredCapabilities"、 "capabilities"]を送信しました Build infoシステム:ホスト: 'SRILAML-N2K0G8W'、ip: '2402:4000:bbfd:c4b:c4f0:811d:c8a6:2'、バージョン: '不明'、修正: '不明'、時刻: '不明' システム情報: os.name: 'Mac OS X'、os.arch: 'x86_64'、os.version:'10 .12.4 '、java.version:' 1.8.0_25 ' ドライバ情報:driver.version:IOSDriver at org。 (ProtocolHandshake.java:353) (org.openqa.selenium.remote.ProtocolHandshake.createSession HttpCommandExecutor.java:142) at io.appium.java_client.remote.AppiumCommandExecuto io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40) でorg.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637) でr.execute(AppiumCommandExecutor.java:69) でio.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) (io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)) at org.openqa.selenium.remote.RemoteWebDriver.startSession org.openqa.selenium.remote.RemoteWebDriverでorg.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236) でRemoteWebDriver.java:250) 。(RemoteWebDriver.java:137) io.appiumで.java_client.DefaultGenericMobileDriver(DefaultGenericMobileDriver.java:36) at io.appium.java_clie (IOSDriver.java:82) at test2(AppiumDriver.java:132) io.appium.java_client.ios.IOSDriver。(IOSDriver.java:82)で をio.appium.java_client.AppiumDriver(AppiumDriver.java:132)に設定してください。 sun.reflect.DelegatingMethodAccessorImpl.invokeでsun.reflect.NativeMethodAccessorImpl.invokeでsun.reflect.NativeMethodAccessorImpl.invoke0(ネイティブメソッド) (NativeMethodAccessorImpl.java:62) (AT .AppiumTestB.setup(AppiumTestB.java:29) (FrameworkMethod.java:50) at org.junit .internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) a t org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner org.junitでorg.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) でorg.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) で.runLeaf(ParentRunner.java:325) .runners.ParentRunner $ 3.run(ParentRunner.java:290) at org.junit.runners。ParentRunner $ 1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access $ 000(ParentRunner.java:58) at org.junit.runners.ParentRunner $ 2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference .run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal .junit.runner.RemoteTestRunner.run org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.mainで(RemoteTestRunner.java:382) (RemoteTestRunner.java:192)

+0

シミュレータまたはリアルデバイス?また、必要な機能でプラットフォーム名を述べる必要があります。 –

答えて

0

これは私が使用されるコードでありますシミュレータで実行します。

//CONFIGURING DEVICE CAPABILITIES 
    DesiredCapabilities capabilities = new DesiredCapabilities(); 
    capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME , "XCUITest"); 
    capabilities.setCapability("platformName",Constant.appPlatform); 
    capabilities.setCapability("deviceName",Constant.device); 
    capabilities.setCapability("platformVersion", Constant.version); 
    capabilities.setCapability("app", app); 

    //Initiate Driver 
    driver = new IOSDriver(new URL("http://127.0.0.1:4724/wd/hub"), capabilities); 

希望します。ありがとう。

関連する問題