first one does not work without open keyboard. and first way is more natural to copy user behavior. e.g. setValue works faster and does not need keyboard but very sometimes it does not work with some fields. in such case better user way with tap on input to appear keyboard and then sendKeys.
i mentioned - first tap on input. then send text. better use your:
driver.findElements(AppiumBy.className("android.widget.EditText")).get(0).sendKeys("000000016");
// or
new Actions(driver).sendKeys(text).perform();
// deprecated in old versions (you did not said what you using)
// driver.getKeyboard().sendKeys(text);
Thanks for your reply.
I have one error after first Tap & then send values its working But after next when i m sending values to next password tab its not sending. Im getting Element not found error.
Could you please let me know how can we close that taped Keyboard to process next.
Attached image for Keyborad open
Im using correct field for password … First clicking on that passowrd filed & then sending values But keyboard is already open before this.
Also tried by sending directly values because keyboard is already open but its also not working.
so could you please help me how can we close that keyboard …?
But its not working because in single sendkeys tab its sending values but here OTP is 6 digits and 6 tabs are opening one after another. But xpath is same for all OTP tab see attached snap
Could you please help how do this …?
I’m getting error while installing apk in emulator …could you please help here what should have to do …?
Exception in thread “main” org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘C:\Users\Admin\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install C://Users//Admin//eclipse-workspace//CUEDOS//src//test//java//resources//app-release-9jan.apk’ exited with code 1’; Command output: adb: failed to install C://Users//Admin//eclipse-workspace//CUEDOS//src//test//java//resources//app-release-9jan.apk: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
Host info: host: ‘DESKTOP-7FP2AUK’, ip: ‘192.168.31.114’
Build info: version: ‘4.6.0’, revision: ‘79f1c02ae20’
System info: os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘17.0.3’
Driver info: io.appium.java_client.android.AndroidDriver
Command: [null, newSession {capabilities=[{appium:deviceName=Oppo A54, platformName=ANDROID, appium:automationName=UIAutomator2, appium:app=C://Users//Admin//eclipse-workspace//CUEDOS//src//test//java//resources//app-release-9jan.apk}], desiredCapabilities=Capabilities {appium:app: C://Users//Admin//eclipse-w…, appium:automationName: UIAutomator2, appium:deviceName: Oppo A54, platformName: ANDROID}}]
Capabilities {}
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:146)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
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:155)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:189)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:541)
at io.appium.java_client.AppiumDriver.startSession(AppiumDriver.java:229)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:157)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:80)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:92)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:117)
at OPPO_A54.ab.main(ab.java:32)