Java client build version or git revision if you use some snapshot: 4.21.0
Appium server version or git revision if you use some snapshot: 2.11.0
Desktop OS/version used to run Appium if necessary:
Node.js version (unless using Appium.app|exe) or Appium CLI or Appium.app|exe:
Mobile platform/version under test: iOS and Android any versions
Real device or emulator/simulator: both
Details
Stack Trace:
at org.openqa.selenium.remote.codec.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:237)
at org.openqa.selenium.remote.codec.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:111)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:178)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:237)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:591)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:307)
at io.appium.java_client.remote.SupportsContextSwitching.getContext(SupportsContextSwitching.java:78)
We created a customized version of AppiumCommandExecutor and added those commands as additional commands to make it work. Since context switching commands are critical for mobile hybrid application tests, those commands would be supported by default, right? Is there anything that I missed when trying to use AppiumCommandExecutor for testing hybrid mobile application tests?
Description
After this change on Java-client: https://github.com/appium/java-client/pull/2093 and on Selenium side: https://github.com/SeleniumHQ/selenium/commit/1b66415adf2bcce266d5acdd457378c4e6d07340. Our test fail when doing getContext().
Environment
Details
Stack Trace:
at org.openqa.selenium.remote.codec.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:237) at org.openqa.selenium.remote.codec.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:111) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:178) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:237) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:591) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:307) at io.appium.java_client.remote.SupportsContextSwitching.getContext(SupportsContextSwitching.java:78)
With debug, I noticed that nameToSpec does not include any mobile-specific commands because of the change: https://github.com/SeleniumHQ/selenium/commit/1b66415adf2bcce266d5acdd457378c4e6d07340. While, change: https://github.com/appium/java-client/pull/2093 added that mobile command in the MobileCommand class, but the commands in commandRepository have not been injected. Therefore AbstractHttpCommandCodec cannot find commands, like getCurrentContextHandle.
We created a customized version of AppiumCommandExecutor and added those commands as additional commands to make it work. Since context switching commands are critical for mobile hybrid application tests, those commands would be supported by default, right? Is there anything that I missed when trying to use AppiumCommandExecutor for testing hybrid mobile application tests?