Skip to content

Keys provided as string in caps being converted to camel case from snake case since selenium v4 base #945

@vm-iiit

Description

@vm-iiit

This is a

  • Bug report
  • Question
  • Freature Request

Summary

Ruby appium is converting capabilities from snake case to camel case

Environment

  • Appium version (or git revision): Appium v1.22.0
  • ruby_lib version: appium_lib (12.0.1)
  • Mobile platform/version/device under test: NA

Actual behaviour and steps to reproduce

  1. Start a local appium server
  2. Use the following script to start session pass capabilities in snake case
require 'rubygems'
require 'appium_lib'

SERVER_URL = "tcp://localhost:4723/wd/hub"

desired_caps = {
  "platformName" => "android",
  "device" => "Samsung Galaxy S21 Ultra",
  "app" => "/Users/viratmishra/Downloads/fast-speed-test-1-0-5.apk", #any local app path
  "os_version" => "11.0",
  "custom_cap" => "custom_value",
  "custom_cap_2" => {
    "custom_nested_key" => "custom_value"
  },
  "custom_cap_3" => {
    "custom_nested_key_2" => {
      "custom_nested_key_3" => "custom_value"
    }
  },
}

appium_driver = Appium::Driver.new({
  'caps' => desired_caps,
  'appium_lib' => {
    :server_url => SERVER_URL
  }}, true)
driver = appium_driver.start_driver

wait = Selenium::WebDriver::Wait.new(timeout: 40)

driver.quit

  1. See the caps received by appium server, in my case
[Appium] 
[Appium]   The next major version of Appium (2.x) will **require** the 
[Appium]   'automationName' capability to be set for all sessions on all 
[Appium]   platforms
[Appium] 
[Appium]   In previous versions (Appium <= 1.13.x), the default was 
[Appium]   'automationName=UiAutomator1'
[Appium] 
[Appium]   If you wish to use that automation instead of UiAutomator2, please 
[Appium]   add 'automationName=UiAutomator1' to your desired capabilities
[Appium] 
[Appium]   For more information about drivers, please visit 
[Appium]   http://appium.io/docs/en/about-appium/intro/ and explore the 
[Appium]   'Drivers' menu
[Appium] 
[Appium] ======================================================================
[Appium] 
[Appium] Appium v1.22.0 creating new AndroidUiautomator2Driver (v1.69.0) session
[Appium] Applying relaxed security to 'AndroidUiautomator2Driver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure
[BaseDriver] Creating session with W3C capabilities: {
[BaseDriver]   "alwaysMatch": {
[BaseDriver]     "platformName": "android",
[BaseDriver]     "appium:device": "Samsung Galaxy S21 Ultra",
[BaseDriver]     "appium:app": "/Users/viratmishra/Downloads/fast-speed-test-1-0-5.apk",
[BaseDriver]     "appium:os_version": "11.0",
[BaseDriver]     "appium:custom_cap": "custom_value",
[BaseDriver]     "appium:custom_cap_2": {
[BaseDriver]       "customNestedKey": "custom_value"
[BaseDriver]     },
[BaseDriver]     "appium:custom_cap_3": {
[BaseDriver]       "customNestedKey_2": {
[BaseDriver]         "customNestedKey_3": "custom_value"
[BaseDriver]       }
[BaseDriver]     }
[BaseDriver]   },
[BaseDriver]   "firstMatch": [
[BaseDriver]     {}
[BaseDriver]   ]
[BaseDriver] }
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   device
[BaseDriver]   os_version
[BaseDriver]   custom_cap
[BaseDriver]   custom_cap_2
[BaseDriver]   custom_cap_3
[BaseDriver] Session created with session id: cc06c35d-3066-4edc-ae56-5154170364f6
[BaseDriver] Using local app '/Users/viratmishra/Downloads/fast-speed-test-1-0-5.apk'
[UiAutomator2] Checking whether app is actually present
[ADB] Using 'adb' from '/Users/viratmishra/Library/Android/sdk_old/platform-tools/adb'
[ADB] Running '/Users/viratmishra/Library/Android/sdk_old/platform-tools/adb -P 5037 start-server'
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device

The caps custom_nested_key , custom_nested_key_2 and custom_nested_key_3 got converted to camelcase when received by appium server: "customNestedKey" , "customNestedKey_2" , "customNestedKey_3"

Expected behaviour

Caps should have remained as they were passed, i.e. in snake case, tried with python client as well and this didn't happen there.

Link to Appium/Ruby logs

https://gist.github.com/vm-iiit/f07fc52b1f915f52fd8603e2403d941b

Any additional comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions