java-client icon indicating copy to clipboard operation
java-client copied to clipboard

bug: appium.io is changing my capability names

Open bistritapcv opened this issue 2 years ago • 5 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

I am running WinAppDriver with appium.io in Java/Eclipse on Windows.

The current behavior is that appium.io is prefixing my "app" and "appId" capabilities with "appium:" (i.e., "appium:app", "appium:appId") while WinAppDriver is expecting just "app" and "appId" and is therefore throwing an error that it is missing capability "appId" (since it is being passed "appium:appId"). I have tried several versions of appium.io in the pom.

Expected Behavior

either appium.io not prefix "appium" (or provide an option), or WinAppDriver recognize capabilities starting with "appium".

Minimal Reproducible Example

(while WinAppDriver is running):

	DesiredCapabilities dcaps = new DesiredCapabilities();
	dcaps.setCapability("automationName", "Windows");
	dcaps.setCapability("appId", "{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}\\notepad.exe}");
	dcaps.setCapability("app", "C:\\Windows\\System32\\notepad.exe");
	dcaps.setCapability("appId", "C:\\Windows\\System32\\notepad.exe");
	dcaps.setCapability("platformName", "Windows");
	dcaps.setCapability("deviceName", "Windows PC");
	WindowsDriver app = new WindowsDriver(new URL("http://127.0.0.1:4723/"), dcaps);

Environment

  • Operating system: Windows 10
  • If running Appium Desktop, its version: Not using Appium, just the java client part for WinAppDriver
  • Appium driver(s) and their version(s): I have tried several versions of appium.io. Current is 5.0.0-BETA6 but I have tried many
  • Platform and version under test: Windows 10

Link to Appium Logs

see below

Futher Information

Caused by: org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 400. Message: Missing command parameter: appId Host info: host: 'XXXXXXXXXX' ,<-redacted Build info: version: '4.5.0', revision: 'fe167b119a' System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_144' Driver info: io.appium.java_client.windows.WindowsDriver Command: [null, newSession {capabilities=[{appium:app=C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe, appium:automationName=Windows, appium:deviceName=Windows PC, platformName=WINDOWS}], desiredCapabilities=Capabilities {app: C:\Program Files (x86)\Wind..., automationName: Windows, deviceName: Windows PC, platformName: WINDOWS}}] Capabilities {} at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:144) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:126) at io.appium.java_client.remote.AppiumProtocolHandshake.createSession(AppiumProtocolHandshake.java:102) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:146) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:180) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:547) at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:224) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:79) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:87) at io.appium.java_client.windows.WindowsDriver.(WindowsDriver.java:48) at xxxxx.xxxxx.enterLoginInfo(xxxxx.java:69)

bistritapcv avatar Apr 12 '23 10:04 bistritapcv

Such behaviour is expected. Java client 8 only support W3C, where vendor prefixes are required for all capabilities except of several standard ones. Either use it with appium-windows-driver, which does the necessary updates as WAD itself only support the legacy JWP protocol or consider using some older clients that still have the legacy JWP support

mykola-mokhnach avatar Apr 12 '23 10:04 mykola-mokhnach

Thanks you. Do you have some examples for older clients?

bistritapcv avatar Apr 12 '23 10:04 bistritapcv

Unfortunately I don't. Microsoft though has several examples in their repository: https://github.com/microsoft/WinAppDriver/tree/master/Samples

mykola-mokhnach avatar Apr 12 '23 11:04 mykola-mokhnach

Winium worked perfectly but IT won't let us use it as there have been no updates in years. I suppose there won't be any more updates?

Sent from Yahoo Mail on Android

On Wed, Apr 12, 2023 at 6:05, Mykola @.***> wrote:

Unfortunately I don't. Microsoft though has several examples in their repository: https://github.com/microsoft/WinAppDriver/tree/master/Samples

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

bistritapcv avatar Apr 12 '23 13:04 bistritapcv

How important is developer mode? I set it on my machine to develop but I am not sure they will allow it on the production machines on which it will run.

bistritapcv avatar Apr 17 '23 11:04 bistritapcv