1
    ((HasClipboard) driver).setClipboardText(“happy testing”);

I use that code to control my android device clipboard but it gives me error. I test this code on remote device android 6.0. Here is my error

Oct 06, 2018 7:47:01 AM org.openqa.selenium.remote.ErrorCodes toStatus INFO: HTTP Status: '404' -> incorrect JSON status mapping for 'unknown method' (405 expected) Exception in thread "main" org.openqa.selenium.UnsupportedCommandException: Method has not yet been implemented Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:05:20.749Z' System info: host: 'ADMIN-PC', ip: '192.168.100.79', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_181' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {appActivity: com.gbwhatsapp.HomeActivity, appPackage: com.gbwhatsapp, databaseEnabled: false, desired: {appActivity: com.gbwhatsapp.HomeActivity, appPackage: com.gbwhatsapp, deviceName: Mito 1, newCommandTimeout: 300, noReset: true, platformName: android, platformVersion: 6.0, udid: 90404820557607}, deviceManufacturer: A67, deviceModel: A67, deviceName: 90404820557607, deviceScreenSize: 360x640, deviceUDID: 90404820557607, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 300, noReset: true, platform: LINUX, platformName: Android, platformVersion: 6.0, takesScreenshot: true, udid: 90404820557607, warnings: {}, webStorageEnabled: false} Session ID: 63e74633-a0be-4314-bd81-9d042a9eda71 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at io.appium.java_client.CommandExecutionHelper.execute(CommandExecutionHelper.java:27) at io.appium.java_client.clipboard.HasClipboard.setClipboard(HasClipboard.java:42) at io.appium.java_client.clipboard.HasClipboard.setClipboardText(HasClipboard.java:63) at mito1.MitoAppiumTest1.runPromotion(MitoAppiumTest1.java:75) at mito1.MitoAppiumTest1.main(MitoAppiumTest1.java:43)

andrew
  • 11
  • 3

1 Answers1

1

The error you get states UnsupportedCommandException: Method has not yet been implemented

It may happen when you use new version of client library and old Appium server version: server has not yet supported or spec was updated for POST /wd/hub/session/:session_id/appium/device/set_clipboard call.

I suggest to install latest Appium server 1.9.1 and update java client library to 6.1.0, then try again:

driver.setClipboardText(“happy testing”) without casting

If you still get error, then report it to https://github.com/appium/appium/issues

dmle
  • 3,498
  • 1
  • 14
  • 22