Not Able to type In Username/Password Text field

Hi,

I am automating hybrid app using Appium.
But what happens is When I execute my script,it opens app and then nothing get typed in Username/Password Text field.

I am using real device Nexus 5
So I am stuck in between.So please and please help me out for this.
I am using appium version 1.2.4.1[Latest]
Please let me know if anyone of you need more info.But please help me for this.
Thanks In Advance

Hi Gaurav,

Could you send code you are using and HTML code for Login screen?
Sometimes you might have to click on textbox to start typing text into it

Thanks,
Sujata

Test Script.txt (2.2 KB)

package fleetmaticspackage;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchAction;

import java.awt.List;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Set;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
//import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class Fleetmaticsclass {

public static RemoteWebDriver driver = null;
//static WebDriver driver2;

//public static AppiumDriver driver = null;

//public WebDriver driverNew;
//public static AppiumDriver Ndriver;

@BeforeClass
public static void LaunchApplication() throws MalformedURLException 
{
	File classpathRoot = new File(System.getProperty("user.dir"));
	File appDir = new File(classpathRoot, "\\lib"); 
	File app = new File(appDir, "c2f.pkg.c2f_fw-1.apk"); 

	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability("deviceName","05f432770a230ce6");
	capabilities.setCapability("platformName","Android");
	capabilities.setCapability(CapabilityType.VERSION, "4.4");
	capabilities.setCapability(CapabilityType.PLATFORM, "WINDOWS");
	capabilities.setCapability("app", app.getAbsolutePath());	
	capabilities.setCapability("app-package","c2f.pkg.c2f_fw");
	capabilities.setCapability("app-activity",".RootActivity");
	driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
	
	driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS );
}

@Test
public static void completefunctionality() throws InterruptedException

{   
	
	WebElement e1 = driver.findElement(By.xpath("//android.widget.EditText[@index='4']"));
	e1.click();
	Thread.sleep(2000);
	e1.sendKeys("gaurav");

}

}

Hi,

Do you have any other properties other than index for text box?
And if it is the only text box on the screen?

What properties do you see when inspecting using Appium?

Thanks,
Sujata

qaguarav2 -

one tool we found pretty helpful at times was driver.getPageSource(). RemoteWebDriver will give you an XML representation of the app as it stands at that moment. Might help you understand whether your query may not be returning what you think it is.

Also, we do click first as he mentions, and seem to have had better success with setValue than sendKeys:


    By by = By.xpath(....);
    ExpectedCondition expectedCondition = ExpectedConditions.elementToBeClickable(by), timeout);
    WebDriverWait wait = new WebDriverWait(driver, timeout);
    MobileElement target = (MobileElement)wait.until(expectedCondition);
    target.click();
    target.setValue("whatever");

Hi pihlenfeldt,

I tried your given code but its not working.
Can you please help me more.Thanks
I need this to be working.

I tried alot on this from last 1 month but no luck.Please anyone help me out.I am in need.

As per my initial assessments capabilities mentioned my you are not correct as per appium documentation. so for better idea can you send appium server logs?

Thanks,
Priyank Shah

Hi Priyank,

Please find server logs below.Also I attached my script with this message:

Checking if an update is available
Update not available
Starting Node Server
info: Welcome to Appium v1.2.4 (REV 71584425ecf777349e3215f0f18e71e7782acfb6)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {“app”:“C:\Softwares\Appium\c2f.pkg.c2f_fw-1.apk”,“address”:“127.0.0.1”,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“19”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/sessione[39m e[90m{“desiredCapabilities”:{“platform”:“WINDOWS”,“app”:“C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk”,“deviceName”:“05f432770a230ce6”,“platformName”:“Android”,“app-package”:“c2f.pkg.c2f_fw”,“app-activity”:“.RootActivity”,“version”:“5.0”}}e[39m
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : platform, app-package, app-activity, version
info: [debug] No appActivity desired capability or server param. Parsing from apk.
info: [debug] No appPackage desired capability or server param. Parsing from apk.
info: [debug] Using local app from desired caps: C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk
info: [debug] Creating new appium session b1ae03d0-5740-443e-a8d0-1a8a0181f6f1
info: Starting android appium
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: [debug] Checking whether adb is present
warn: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.
info: [debug] Using adb from C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe

info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” devices
info: [debug] 1 device(s) connected
info: Found device 05f432770a230ce6
info: [debug] Setting device id to 05f432770a230ce6
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 wait-for-device
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Parsing package and activity from app manifest
info: [debug] Checking whether aapt is present
warn: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for aapt.
info: [debug] Using aapt from C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\aapt.exe

info: [debug] packageAndLaunchActivityFromManifest: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\aapt.exe” dump badging “C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk”
info: [debug] badging package: c2f.pkg.c2f_fw
info: [debug] badging act: c2f.pkg.c2f_fw.C2F_AppActivity
info: [debug] Parsed package and activity are: c2f.pkg.c2f_fw/c2f.pkg.c2f_fw.C2F_AppActivity
info: [debug] Getting device API level
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 21
info: Device API level is: 21
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “getprop persist.sys.language”
info: [debug] Current device language: en
info: [debug] java -jar “C:\Softwares\Appium\AppiumForWindows\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk” “C:\Windows\Temp\c2f.pkg.c2f_fw” en
info: [debug] No strings.xml for language ‘en’, getting default strings.xml
info: [debug] java -jar “C:\Softwares\Appium\AppiumForWindows\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk” “C:\Windows\Temp\c2f.pkg.c2f_fw”
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 push “C:\Windows\Temp\c2f.pkg.c2f_fw\strings.json” /data/local/tmp
info: [debug] Checking whether aapt is present
warn: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for aapt.
info: [debug] Using aapt from C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\aapt.exe

info: [debug] processFromManifest: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\aapt.exe” dump xmltree “C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk” AndroidManifest.xml
info: [debug] Set app process to: c2f.pkg.c2f_fw
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk: java -jar “C:\Softwares\Appium\AppiumForWindows\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” “C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk”
info: [debug] App already signed.
info: [debug] Zip-aligning C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk
info: [debug] Checking whether zipalign is present
warn: The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for zipalign.
info: [debug] Using zipalign from C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\zipalign.exe

info: [debug] zipAlignApk: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\zipalign.exe” -f 4 “C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk” “C:\Users\Gaurav\AppData\Local\Temp\appium1141024-7380-dyckkb.tmp”
info: [debug] MD5 for app is 0dfd5bee1388d8f9beb0840e5b3a07a5
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “ls /data/local/tmp/0dfd5bee1388d8f9beb0840e5b3a07a5.apk”
info: [debug] Getting install status for c2f.pkg.c2f_fw
info: [debug] Getting device API level
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 21
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “pm list packages -3 c2f.pkg.c2f_fw”
info: [debug] App is installed
info: App is already installed, resetting app
info: [debug] Running fast reset (stop and clear)
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “am force-stop c2f.pkg.c2f_fw”
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “pm clear c2f.pkg.c2f_fw”
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 push “C:\Softwares\Appium\AppiumForWindows\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 install “C:\Softwares\Appium\AppiumForWindows\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Pushing unlock helper app to device…
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 install “C:\Softwares\Appium\AppiumForWindows\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk”
info: Starting App
info: [debug] Attempting to kill all ‘uiautomator’ processes
info: [debug] Getting all processes with ‘uiautomator’
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe -s 05f432770a230ce6 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunnere[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServere[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrape[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1e[39m
info: [debug] e[90m[UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1e[39m
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] [BOOTSTRAP] [debug] Loading json…
info: [debug] [BOOTSTRAP] [debug] json loading complete.
info: [debug] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
info: [debug] [BOOTSTRAP] [debug] Client connected
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“wake”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: wake
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “dumpsys window”
info: [debug] Writing dumpsys output to C:\Softwares\Appium\AppiumForWindows\Appium\node_modules\appium.dumpsys.log
info: [debug] Screen already unlocked, continuing.
info: [debug] Pushing command to appium work queue: [“getDataDir”,{}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“getDataDir”,“params”:{}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“/data/local/tmp”}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: [“compressedLayoutHierarchy”,{“compressLayout”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“compressedLayoutHierarchy”,“params”:{“compressLayout”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:false}
info: [debug] Getting device API level
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 21
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n c2f.pkg.c2f_fw/c2f.pkg.c2f_fw.C2F_AppActivity”
info: [debug] Waiting for pkg “c2f.pkg.c2f_fw” and activity “c2f.pkg.c2f_fw.C2F_AppActivity” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing: “C:\Softwares\Appium\eclipse-standard-luna-R-win32-x86_64\sdk\platform-tools\adb.exe” -s 05f432770a230ce6 shell “dumpsys window windows”
info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to the default of 60 secs
info: [debug] Appium session started with sessionId b1ae03d0-5740-443e-a8d0-1a8a0181f6f1
info: e[37m<-- POST /wd/hub/session e[39me[36m303e[39me[90m 16485.649 ms - 9e[39m e[90me[39m
info: e[37m–>e[39m e[37mGETe[39m e[37m/wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1e[39m e[90m{}e[39m
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”:“WINDOWS”,“browserName”:“Android”,“platformVersion”:“4.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platform”:“WINDOWS”,“app”:“C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk”,“deviceName”:“05f432770a230ce6”,“platformName”:“Android”,“app-package”:“c2f.pkg.c2f_fw”,“app-activity”:“.RootActivity”,“version”:“5.0”},“app”:“C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk”,“deviceName”:“05f432770a230ce6”,“platformName”:“Android”,“app-package”:“c2f.pkg.c2f_fw”,“app-activity”:“.RootActivity”,“version”:“5.0”},“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}
info: e[37m<-- GET /wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1 e[39me[32m200e[39me[90m 10.310 ms - 786e[39m e[90m{“status”:0,“value”:{“platform”:“WINDOWS”,“browserName”:“Android”,“platformVersion”:“4.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“platform”:“WINDOWS”,“app”:“C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk”,“deviceName”:“05f432770a230ce6”,“platformName”:“Android”,“app-package”:“c2f.pkg.c2f_fw”,“app-activity”:“.RootActivity”,“version”:“5.0”},“app”:“C:\Users\Gaurav\workspaceappium\Fleetmatics\lib\c2f.pkg.c2f_fw-1.apk”,“deviceName”:“05f432770a230ce6”,“platformName”:“Android”,“app-package”:“c2f.pkg.c2f_fw”,“app-activity”:“.RootActivity”,“version”:“5.0”},“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}e[39m
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/timeouts/implicit_waite[39m e[90m{“ms”:15000}e[39m
info: [debug] Set Android implicit wait to 15000ms
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}
info: e[37m<-- POST /wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/timeouts/implicit_wait e[39me[32m200e[39me[90m 4.425 ms - 76e[39m e[90m{“status”:0,“value”:null,“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}e[39m
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/elemente[39m e[90m{“using”:“xpath”,“value”:“//android.widget.EditText[@index=‘4’]”}e[39m
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13}
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:“//android.widget.EditText[@index=‘4’]”,“context”:“”,“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //android.widget.EditText[@index=‘4’] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.EditText, INSTANCE=0]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“1”}}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}
info: e[37m<-- POST /wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/element e[39me[32m200e[39me[90m 7192.043 ms - 87e[39m e[90m{“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}e[39m
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/element/1/clicke[39m e[90m{“id”:“1”}e[39m
info: [debug] Pushing command to appium work queue: [“element:click”,{“elementId”:“1”}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“1”}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: click
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}
info: e[37m<-- POST /wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/element/1/click e[39me[32m200e[39me[90m 3047.341 ms - 76e[39m e[90m{“status”:0,“value”:true,“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}e[39m
info: e[37m–>e[39m e[37mPOSTe[39m e[37m/wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/element/1/valuee[39m e[90m{“id”:“1”,“value”:[“gaurav”]}e[39m
info: [debug] Pushing command to appium work queue: [“element:setText”,{“elementId”:“1”,“text”:“gaurav”,“replace”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:setText”,“params”:{“elementId”:“1”,“text”:“gaurav”,“replace”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: setText
info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: gaurav
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}
info: e[37m<-- POST /wd/hub/session/b1ae03d0-5740-443e-a8d0-1a8a0181f6f1/element/1/value e[39me[32m200e[39me[90m 4743.211 ms - 76e[39m e[90m{“status”:0,“value”:true,“sessionId”:“b1ae03d0-5740-443e-a8d0-1a8a0181f6f1”}e[39m
Test Script.txt (2.2 KB)

As per logs, it says mentioned capabilities are wrong. Please find below code about correct capabilities (As per appium docs http://appium.io/slate/en/v1.3.3/?java#appium-server-capabilities).
https://github.com/priyankshah217/AppiumTestAutomation/blob/master/src/test/java/com/test/utils/AppUtils.java

Hi Priyank,

I tried your code as well but it gives me RED Marks On My Script.Can You explain More in Brief what needs to be done here.

Can You make Change in my “Test Script.txt” which I attached in Last Message or please give me complete info.

Hello All,

I tried below action but unable to set the text in text field.

  1. driver.findElementById(“com.apptivateme.next.la:id/etUserEmail”).sendKeys("[email protected]");

driver.findElementsByClassName(“android.widget.EditText”).get(0).sendKeys("[email protected]");

Please let me know if anyone got solution for this.

Thanks

Hello Ashishta,

I have seen your code but some syntex was not correct in the code so you can try with below code.

1.driver.findElement(By.id(“com.apptivateme.next.la:id/etUserEmail”)).sendKeys("[email protected]");

2.driver.findElement(By.className(“android.widget.EditText”).sendKeys("[email protected]");

Thanks
Nitesh Harit

Hi ,
I am also facing the same issue with iOS mobile app, appium in java
SendKeys is not working and does not takes username password although on android everything was working fine.

Below code should work,

Select Textbox first by clicking on it and then call sendkeys.

driver.findElement(By.id(“com.apptivateme.next.la:id/etUserEmail”)).click();
driver.findElement(By.id(“com.apptivateme.next.la:id/etUserEmail”)).sendKeys("[email protected]")

Click on the field when you need to enter the text

driver…getKeyboard().sendKeys(“Text”)

I tried even this approach but I wasn’t able to type in the text in text field over simulator. I am using XCode 9.4 and simulator with version 11.4

Might as well try element.clear and then try sendkeys

n As we all know…Appium sucks big time…