Client ignoring Capabilities and Bad Parameter Errors
See original GitHub issueDescription
The Java client seems to send the w3c desired capabilities in a wrong format so that the server throws an error. And the client is not sending some capabilities such as forceMjsonwp capability
Environment
- java client: 6.0.0
- Appium server: 1.8.2-beta
- Desktop OS/version: Windows 7
- Node.js version: 8.11.1
- Mobile platform/version under test: Android
- Real device: Google Pixel 2 (Androui 8.1) ans Samsung Galaxy S6 (Android 7.0)
Details
I always get a w3c bad parameter error if I want to set the implicit wait time outs.
[HTTP] --> POST /wd/hub/session/45e323c1-1248-4207-95b3-22a21ec5600f/timeouts
[HTTP] {"type":"implicit","ms":30000}
[debug] [W3C] Bad parameters: BadParametersError: Parameters were incorrect. We wanted "W3C prot
ad or implicit to be set" and you sent {"type":"implicit","ms":30000}
[HTTP] <-- POST /wd/hub/session/45e323c1-1248-4207-95b3-22a21ec5600f/timeouts 400 5 ms - 5372
Therefore I treid to force MJSONWP Protocol with forceMjsonwp capability. But forceMjsonwp capability is not send from java client to appium server. Seems like client is ignoring this capability. If I try to add the forceMjsonwp capability manually into a session I created by hand with a rest client everything works fine.
I tried to set forceMjsonwp capability in both ways
capabilities.setCapability(MobileCapabilityType.FORCE_MJSONWP, true);
capabilities.setCapability("forceMjsonwp ", true);
Neither is send from client to server.
Code To Reproduce Issue
public AppiumDriver<?> setupAndroidDriver(String deviceID, String androidVersion, String appPackage, String activity, String appiumServer) throws MalformedURLException{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, deviceID);
capabilities.setCapability("udid", deviceID);
capabilities.setCapability(MobileCapabilityType.FORCE_MJSONWP, true);
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, androidVersion);
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "Android");
capabilities.setCapability("appWaitDuration", 20000);
capabilities.setCapability(MobileCapabilityType.NO_RESET, true);
capabilities.setCapability(MobileCapabilityType.FULL_RESET, false);
capabilities.setCapability("appPackage", appPackage);
capabilities.setCapability("appActivity", activity);
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "UiAutomator2");
driver = new AppiumDriver<MobileElement>(new URL(appiumServer), capabilities);
driver.manage().timeouts().implicitlyWait(30000, TimeUnit.MILLISECONDS);
return driver;
}
Link to Appium logs
https://gist.github.com/FelixHahn/93faef358769bebdd34f931303b5a1ba
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (10 by maintainers)
Top GitHub Comments
@dpgraham Yes. in Ruby and Python client, I delete
forceMjsonwp
from desired capability. And if the property exists,{ desiredCapabilities: desired_capabilities }
will send instead of{alwaysMatch: {...}, firstMatch: [{...}, ...}
@SrinivasanTarget just so you know, it’s a non-standard capability, it’s just there so that users can fall back to MJSONWP.