From e314b7b550de12294f2a30ce7ad6996577ad48d8 Mon Sep 17 00:00:00 2001 From: Nic Di Noia <24900139+nicodn@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:31:55 -0400 Subject: [PATCH] FIX CanReplaceElementValue.java The correct command name is `replaceElementValue` https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-replaceelementvalue Currently this method gives an error on Appium 2.4.1: ``` 2024-04-23 23:28:35:720 - [AndroidUiautomator2Driver@e813 (57f911b5)] Executing method 'mobile: replaceValue' 2024-04-23 23:28:35:762 - [AndroidUiautomator2Driver@e813 (57f911b5)] Encountered internal error running command: UnknownCommandError: Unknown mobile command "mobile: replaceValue". Only shell, execEmuConsoleCommand, dragGesture, flingGesture, doubleClickGesture, clickGesture, longClickGesture, pinchCloseGesture, pinchOpenGesture, swipeGesture, scrollGesture, scrollBackTo, scroll, viewportScreenshot, viewportRect, deepLink, startLogsBroadcast, stopLogsBroadcast, deviceidle, acceptAlert, dismissAlert, batteryInfo, deviceInfo, getDeviceTime, changePermissions, getPermissions, performEditorAction, startScreenStreaming, stopScreenStreaming, getNotifications, openNotifications, listSms, type, replaceElementValue, pushFile, pullFile, pullFolder, deleteFile, isAppInstalled, queryAppState, activateApp, removeApp, terminateApp, installApp, clearApp, backgroundApp, getCurrentActivity, getCurrentPackage, startActivity, startService, stopService, broadcast, getContexts, getAppStrings, installMultipleApks, lock, unlock, isLocked, refreshGpsCache, startMediaProjectionRecording, isMediaProjectionRecordingRunning, stopMediaProjectionRecording, getConnectivity, setConnectivity, toggleGps, isGpsEnabled, hideKeyboard, isKeyboardShown, pressKey, getDisplayDensity, getSystemBars, fingerprint, sendSms, gsmCall, gsmSignal, gsmVoice, powerAc, powerCapacity, networkSpeed, sensorSet, getPerformanceData, getPerformanceDataTypes, statusBar, screenshots, scheduleAction, getActionHistory, unscheduleAction, getUiMode, setUiMode, sendTrimMemory commands are supported. ``` --- .../io/appium/java_client/android/CanReplaceElementValue.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/appium/java_client/android/CanReplaceElementValue.java b/src/main/java/io/appium/java_client/android/CanReplaceElementValue.java index 447377633..3c42f5c35 100644 --- a/src/main/java/io/appium/java_client/android/CanReplaceElementValue.java +++ b/src/main/java/io/appium/java_client/android/CanReplaceElementValue.java @@ -21,7 +21,7 @@ public interface CanReplaceElementValue extends ExecutesMethod, CanRememberExten * off from the typed text). */ default void replaceElementValue(RemoteWebElement element, String value) { - final String extName = "mobile: replaceValue"; + final String extName = "mobile: replaceElementValue"; try { CommandExecutionHelper.executeScript(assertExtensionExists(extName), extName, Map.of( "elementId", element.getId(),