Skip to content

[🐛 Bug]: Android application test starts chrome instead of application #17274

@bhecquet

Description

@bhecquet

Description

Hello

I've updated to Selenium grid 4.41 and now, when I create a session with such capabilities

{"appium:app": "http://127.0.0.1:44454/de.moekadu.metronome_52.apk", 
"appium:appActivity": "de.moekadu.metronome.MainActivity", 
"appium:automationName": "UIAutomator2", 
"appium:deviceName": "sdk_gphone64_x86_64", 
"appium:fullReset": true, 
"appium:newCommandTimeout": 120, 
"appium:platformVersion": 14, 
"appium:udid": "emulator-5554", 
"goog:chromeOptions": {}, 
"platformName": "ANDROID"}

It starts chrome on my Android emulator

And in fact, appium receives

 {
  "alwaysMatch": {
    "browserName": "chrome",
    "goog:chromeOptions": {},
    "platformName": "ANDROID",
    "appium:app": "http://127.0.0.1:44454/de.moekadu.metronome_52.apk",
    "appium:appActivity": "de.moekadu.metronome.MainActivity",
    "appium:automationName": "UIAutomator2",
    "appium:deviceName": "sdk_gphone64_x86_64",
    "appium:fullReset": true,
    "appium:newCommandTimeout": 120,
    "appium:platformVersion": "14",
    "appium:udid": "emulator-5554"
  },
  "firstMatch": [
    {}
  ]
}

Here is the stereotype of the Android emulator slot

 {
            "id": {
              "hostId": "8d0aa570-2cea-4294-bc9e-d8ede9efd727",
              "id": "db7c401f-f853-47b9-a409-ecde457839d8"
            },
            "lastStarted": "1970-01-01T00:00:00Z",
            "session": null,
            "stereotype": {
              "appium:deviceName": "sdk_gphone64_x86_64",
              "appium:platformVersion": "14",
              "browserName": "chrome",
              "platformName": "ANDROID",
            }
          },

For information, my stereotype specifies "chrome" as possible browser for the mobile slot, because on this android emulator, we may start either browser or application tests

The fact is that PR #15537 and #17097 put capability filtering in a method which looks if provided capabilities / stereotype contains some appium application related capabilities (e.g: "appium.app") to check if capabilities should be filtered.
But in case of stereotype, these keys have little chance to be provided, as, from my comprehension, they are test related

So this line

capabilities = capabilities.merge(filterRelayCapabilities(stereotype));
is probably wrong

Reproducible Code

May be provided later, but I think all information are present in the description

Debugging Logs

No logs to provide

ℹ️ Last known working version: 4.38

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-gridEverything grid and server relatedC-javaJava BindingsI-defectSomething is not working as intendedI-regressionSomething was working but we "fixed" it

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions