1

I was trying to setup a project with Java and Appium. Thing is that I am just learning it and I got stuck on first few lines of the code Screenshot of the issue

I am trying to set the "Desired Capabilities" but there is an issue stating that these are invalid capabilities. I have tried to look into the docs as well but cannot figure out how to fix it. Would be great help if anyone can help it out.

Aksel
  • 11
  • 3

4 Answers4

2

You can try adding "appium:" to the capabilities

DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("appium:deviceName", "deviceName");
cap.setCapability("appium:app", fs.getAbsolutePath());
Will
  • 21
  • 1
0

Try to get instance from UiAutomator2Options class to applies specific capabilities instead of DesiredCapabilities when you get instance from AndroidDriver.

https://www.selenium.dev/blog/2022/legacy-protocol-support/

UiAutomator2Options options = new UiAutomator2Options();
options.setDeviceName("testemulator");
downburst
  • 1
  • 2
0

I think there was a change to the "latest" tag for selenium/standalone-chrome which is causing this problem.

Try pulling a prior version. I had your the same error you had with "latest" but I pulled "101.0.4951.41" and my tests are working again.

Thomas
  • 181
  • 2
  • 5
0

Try pulling a prior version. I had your the same error you had with "latest" but I pulled "101.0.4951.41" and my tests are working again.

Hi, It's not clear to me. Prior version of what please.