Background:
O/S Mac Air ver 10.13.4
Appium Version 1.5.3 (Ara)
Java 1.8
Hi guys I hope you can help me with my problem. I just tried to run my Desired Capabilities for the 1st time and I got the following error message from Eclipse. See the attached video here
Java code from eclipse
package basics;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;
public class Invoke {
public static void main(String[] args) throws MalformedURLException {
// TODO Auto-generated method stub
File f = new File("/Users/jacquelinegeorge/Documents/Appium/Apps");
File fs=new File (f,âApiDemos-debug.apkâ);
DesiredCapabilities cap =new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.DEVICE_NAME, âJacquelineNexus5â);
cap.setCapability(MobileCapabilityType.APP, fs.getAbsolutePath() );
AndroidDriver driver = new AndroidDriver<>(new URL(âhttp://127.0.0.1:4723/wd/hubâ),cap);
}
}
Code from Eclipse Terminal
========================
Exception in thread âmainâ org.openqa.selenium.WebDriverException: Unable to parse remote response: Parameters were incorrect. We wanted {ârequiredâ:[âdesiredCapabilitiesâ],âoptionalâ:[ârequiredCapabilitiesâ,âsessionIdâ,âidâ]} and you sent [âdesiredCapabilitiesâ,âcapabilitiesâ]
Build info: version: â3.9.1â, revision: â63f7b50â, time: â2018-02-07T22:42:22.379Zâ
System info: host: âJacquelines-MacBook-Air.localâ, ip: â192.168.0.5â, os.name: âMac OS Xâ, os.arch: âx86_64â, os.version: â10.13.4â, java.version: â1.8.0_71â
Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:111)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:138)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at basics.Invoke.main(Invoke.java:25)
Code from Appium
================================
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 42 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 30 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 233 ms - 83
[HTTP] --> POST /wd/hub/session {âdesiredCapabilitiesâ:{âappâ:"/Users/jacquelinegeorge/Documents/Appium/Apps/ApiDemos-debug.apk",âdeviceNameâ:âJacquelineNexus5â,âplatformNameâ:âAndroidâ},âcapabilitiesâ:{âdesiredCapabilitiesâ:{âappâ:"/Users/jacquelinegeorge/Documents/Appium/Apps/ApiDemos-debug.apk",âdeviceNameâ:âJacquelineNexus5â,âplatformNameâ:âAndroidâ},âfirstMatchâ:[{âplatformNameâ:âandroidâ}]}}
[debug] [MJSONWP] Bad parameters: BadParametersError: Parameters were incorrect. We wanted {ârequiredâ:[âdesiredCapabilitiesâ],âoptionalâ:[ârequiredCapabilitiesâ,âsessionIdâ,âidâ]} and you sent [âdesiredCapabilitiesâ,âcapabilitiesâ]
[HTTP] <-- POST /wd/hub/session 400 21 ms - 178
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 75 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 100 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 92 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 107 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 80 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 95 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 64 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 69 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 26 ms - 83
[HTTP] --> GET /wd/hub/status {}
[MJSONWP] Calling AppiumDriver.getStatus() with args: []
[MJSONWP] Responding to client with driver.getStatus() result: {âbuildâ:{âversionâ:â1.5.3ââŚ
[HTTP] <-- GET /wd/hub/status 200 28 ms - 83