appium: Appium 1.6.3 error Real device

The problem

In Appium 1.6.3, getting the error ‘Bad parameters: BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“capabilities”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”]} and you sent [“capabilities”]’

In Intellij, getting the error 'Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=/Users/admin/Desktop/IntegrationApp.app, appiumVersion=1.6.3, platformVersion=10.2, platformName=iOS, udid=86997a848f41407ce0419720a3e630458bd4473d, deviceName=Stephania’s iPhone, launchTimeout=500000}], required capabilities = Capabilities [{}],

Environment

  • Appium version 1.6.3
  • Mac 10.12.2
  • Real device iphone 6s plus
  • Intellij idea

Code To Reproduce Issue

public class First_Appium_Run {
   private static IOSDriver<MobileElement> wd;

   public static void main(String[] args) throws MalformedURLException, InterruptedException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, "1.6.3");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.2");
        capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Stephania's iPhone");
        capabilities.setCapability(MobileCapabilityType.UDID, "86997a848f41407ce0419720a3e630458bd4473d");
        capabilities.setCapability(MobileCapabilityType.APP, "/Users/admin/Desktop/IntegrationApp.app");
        //capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "IOS_XCUI_TEST");
        //capabilities.setCapability("bundleId", "com.MysamPhone.Integration");
        //driver = new IOSDriver(new URL(""), capabilities);
        capabilities.setCapability(IOSMobileCapabilityType.LAUNCH_TIMEOUT, 500000);
        wd = new IOSDriver (new URL("http://0.0.0.0:4723/wd/hub"), capabilities);
        wd.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
        wd.findElement(By.name("Alerts"));


    }
}

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 1
  • Comments: 25 (5 by maintainers)

Most upvoted comments

@fionazj, it seems to be issue with your code which initializes the webdriver. It may not be compatible with latest selenium and appium libraries that you are using.

I had the same error with Appium-Python-Client==0.24 module on Appium 1.5.3 version. I figured out that its because of the latest selenium library (selenium-3.4.3) that I am using which was not compatible with the desired capabilities dict I am passing to web driver. So downgraded the selenium lib to 2.47.0 and issue was solved.

Error:- BadParametersError: Parameters were incorrect. We wanted {“required”:[“desiredCapabilities”],“optional”:[“requiredCapabilities”,“capabilities”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”,“sessionId”,“id”]} and you sent [“capabilities”]’

@stjean33 You are giving both UDID and .app. If you wanted to run on real device, please give .ipa and UDID. Incase if you wanna run on sim specify .app, device name and not the UDID. Please use java-client Beta 4 for your tests to work not Beta 5 as we have issues in Beta 5 where the fix is in progress already.

@stjean33 Please try this capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.IOS); instead of capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “iOS”);

I think this would be better asked of the Java-client group (https://github.com/appium/java-client/issues/new). The server expects there to be a parameter called desiredCapabilities and your library is not sending it.