((HasClipboard) driver).setClipboardText("happy testing"); error


#1

Hello, i try to use ((HasClipboard) driver).setClipboardText(“happy testing”); 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)


#2

The method only works with UIAutomator2


#3

Ahh i see, thankyou for your reply