Not Able to type In Username/Password Text field

Hi Guys,

I am new with Appium and after wants to ask about an issue which I am facing.

I am using the remotewebdriver for launching the android application and it gets launched successfully.
So when I try to enter values in username and Password field it fails and return an error “An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)”

I had also used Assert to verify elements and it displayed elements.
issue is while entering values in text field. I had also attached my code below:

The code is as below:

public class gopageSigninTest{

WebDriver driver;
@BeforeClass
public void setUp() throws MalformedURLException{
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(“deviceName”, “Redmi”);
capabilities.setCapability(“platformVersion”, “6.0”);
capabilities.setCapability(“platformName”, “Android”);
capabilities.setCapability(“appPackage”, “com.gopage.android.GoPageClientApp”);
capabilities.setCapability(“appActivity”,“com.gopage.android.GoPageClientApp.activity.Splash”);
driver = new RemoteWebDriver(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS );
}

   @Test	
      public void signin() throws Exception{
          driver.findElement(By.id("email_field"));
       System.out.println("-----1----");
       Assert.assertTrue(driver.findElement(By.id("/email_field")).isDisplayed(), "element is not displayed");
	System.out.println("-----2----");
	driver.findElement(By.id("password_field"));
	System.out.println("-----3----");
	Assert.assertTrue(driver.findElement(By.id("password_field")).isDisplayed(), "element is not displayed");
	System.out.println("-----4----");
           WebElement email=driver.findElement(By.id("password_field"));	
	email.click();
	Thread.sleep(2000);
	email.sendKeys("abc");

        @AfterMethod	    
	public void closeApp() {	           
		driver.quit();	     
		}	
	
	}

Given your sample code block, did you see all four of the debug prints?
Is it failing at the click() or sendKeys()?

What happens if you try this at the beginning of signin():

driver.findElement(By.id(“email_field”)).click();
driver.findElement(By.id(“email_field”)).sendKeys(“abc”);

Same error?

Could you provide the appium server logs?

Hi,

If I try to click at beginning of signin() in Email field it returns same error as for entering value in username and Password field.
Below I had copied the appium logs:

info: → POST /wd/hub/session {“desiredCapabilities”:{“appPackage”:“com.gopage.android.GoPageClientApp”,“appActivity”:“com.gopage.android.GoPageClientApp.activity.Splash”,“platformVersion”:“6.0”,“platformName”:“Android”,“deviceName”:“Redmi”}}
info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_111)
info: [debug] Using local app from command line: E:\appium_download\GoPagedev.apk
info: [debug] Creating new appium session 0a7d4403-c54f-42a9-965a-ca668e6e89bd
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_111
info: [debug] Checking whether adb is present
info: [debug] Using adb from C:\androidSDK\platform-tools\adb.exe
info: [debug] Using fast reset? true
info: [debug] Preparing device for session
info: [debug] Checking whether app is actually present
info: Retrieving device
info: [debug] Trying to find a connected android device
info: [debug] Getting connected devices…
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device e08ddce17d73
info: [debug] Setting device id to e08ddce17d73
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 wait-for-device
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “echo ‘ready’”
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 23
info: Device API level is: 23
info: [debug] Extracting strings for language: default
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “getprop persist.sys.language”
info: [debug] Current device persist.sys.language:
info: [debug] java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “E:\appium_download\GoPagedev.apk” “C:\Users\HIMANS~1.SUR\AppData\Local\Temp\com.gopage.android.GoPageClientApp”
info: [debug] Reading strings from converted strings.json
info: [debug] Setting language to default
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 push “C:\Users\HIMANS~1.SUR\AppData\Local\Temp\com.gopage.android.GoPageClientApp\strings.json” /data/local/tmp
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from C:\androidSDK\build-tools\25.0.2\aapt.exe
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: C:\androidSDK\build-tools\25.0.2\aapt.exe dump xmltree E:\appium_download\GoPagedev.apk AndroidManifest.xml
info: [debug] Set app process to: com.gopage.android.GoPageClientApp
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for E:\appium_download\GoPagedev.apk.
info: [debug] executing cmd: java -jar “C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” E:\appium_download\GoPagedev.apk
info: [debug] App already signed.
info: [debug] Zip-aligning E:\appium_download\GoPagedev.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from C:\androidSDK\build-tools\25.0.2\zipalign.exe
info: [debug] Zip-aligning apk.
info: [debug] executing cmd: C:\androidSDK\build-tools\25.0.2\zipalign.exe -f 4 E:\appium_download\GoPagedev.apk C:\Users\HIMANS~1.SUR\AppData\Local\Temp\11719-9576-1q29sdp\appium.tmp
info: [debug] MD5 for app is 9c89552842a14198685257a1091770c0
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “ls /data/local/tmp/9c89552842a14198685257a1091770c0.apk”
info: [debug] Getting install status for com.gopage.android.GoPageClientApp
info: [debug] Getting device API level
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 23
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “pm list packages -3 com.gopage.android.GoPageClientApp”
info: [debug] App is installed
info: App is already installed, resetting app
info: [debug] Running fast reset (stop and clear)
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “am force-stop com.gopage.android.GoPageClientApp”
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “pm clear com.gopage.android.GoPageClientApp”
info: [debug] Forwarding system:4724 to device:4724
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device…
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 push “C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar” /data/local/tmp/
info: [debug] Pushing settings apk to device…
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 install “C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk”
info: [debug] Pushing unlock helper app to device…
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 install “C:\Program Files (x86)\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 cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “ps ‘uiautomator’”
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.gopage.android.GoPageClientApp -e disableAndroidWatchers false
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
info: [debug] Waking up device if it’s not alive
info: [debug] Pushing command to appium work queue: [“wake”,{}]
info: [debug] [BOOTSTRAP] [debug] Loading json…
info: [debug] [BOOTSTRAP] [debug] json loading complete.
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 cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “dumpsys window”
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] Getting device API level
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “getprop ro.build.version.sdk”
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:false}
info: [debug] Device is at API Level 23
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.gopage.android.GoPageClientApp/com.gopage.android.GoPageClientApp.activity.Splash”
info: [debug] Waiting for pkg “com.gopage.android.GoPageClientApp” and activity “com.gopage.android.GoPageClientApp.activity.Splash” to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “dumpsys window windows”
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “getprop ro.build.version.release”
info: [debug] Device is at release version 6.0.1
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 0a7d4403-c54f-42a9-965a-ca668e6e89bd
info: ← POST /wd/hub/session 303 20252.644 ms - 74
info: → GET /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd {}
info: [debug] Responding to client with success: {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“6.0.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“appPackage”:“com.gopage.android.GoPageClientApp”,“appActivity”:“com.gopage.android.GoPageClientApp.activity.Splash”,“platformVersion”:“6.0”,“platformName”:“Android”,“deviceName”:“Redmi”},“appPackage”:“com.gopage.android.GoPageClientApp”,“appActivity”:“com.gopage.android.GoPageClientApp.activity.Splash”,“platformName”:“Android”,“deviceName”:“e08ddce17d73”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← GET /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd 200 2.626 ms - 686 {“status”:0,“value”:{“platform”:“LINUX”,“browserName”:“Android”,“platformVersion”:“6.0.1”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“appPackage”:“com.gopage.android.GoPageClientApp”,“appActivity”:“com.gopage.android.GoPageClientApp.activity.Splash”,“platformVersion”:“6.0”,“platformName”:“Android”,“deviceName”:“Redmi”},“appPackage”:“com.gopage.android.GoPageClientApp”,“appActivity”:“com.gopage.android.GoPageClientApp.activity.Splash”,“platformName”:“Android”,“deviceName”:“e08ddce17d73”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: → POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/timeouts {“type”:“implicit”,“ms”:15000}
info: [debug] Set Android implicit wait to 15000ms
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/timeouts 200 2.996 ms - 76 {“status”:0,“value”:null,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: → POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element {“using”:“id”,“value”:“email_field”}
info: [debug] Waiting up to 15000ms for condition
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“id”,“selector”:“email_field”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“email_field”,“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 email_field using ID with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.gopage.android.GoPageClientApp:id/email_field]
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=android:id/email_field]
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[DESCRIPTION=email_field, INSTANCE=0]
info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
info: [debug] [BOOTSTRAP] [debug] Finding email_field using ID with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.gopage.android.GoPageClientApp:id/email_field]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“1”}}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element 200 3717.627 ms - 87 {“status”:0,“value”:{“ELEMENT”:“1”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: → POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element {“using”:“id”,“value”:“com.gopage.android.GoPageClientApp:id/email_field”}
info: [debug] Waiting up to 15000ms for condition
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“id”,“selector”:“com.gopage.android.GoPageClientApp:id/email_field”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“com.gopage.android.GoPageClientApp:id/email_field”,“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 com.gopage.android.GoPageClientApp:id/email_field using ID with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.gopage.android.GoPageClientApp:id/email_field]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“2”}}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“2”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element 200 13.674 ms - 87 {“status”:0,“value”:{“ELEMENT”:“2”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: → GET /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element/2/displayed {}
info: [debug] Pushing command to appium work queue: [“element:getAttribute”,{“elementId”:“2”,“attribute”:“displayed”}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:getAttribute”,“params”:{“elementId”:“2”,“attribute”:“displayed”}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getAttribute
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“true”}
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← GET /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element/2/displayed 200 13.976 ms - 76 {“status”:0,“value”:true,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: → POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element {“using”:“id”,“value”:“email_field”}
info: [debug] Waiting up to 15000ms for condition
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“id”,“selector”:“email_field”,“context”:“”,“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“id”,“selector”:“email_field”,“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 email_field using ID with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.gopage.android.GoPageClientApp:id/email_field]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:{“ELEMENT”:“3”}}
info: [debug] Responding to client with success: {“status”:0,“value”:{“ELEMENT”:“3”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element 200 19.164 ms - 87 {“status”:0,“value”:{“ELEMENT”:“3”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: → POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element/3/click {“id”:“3”}
info: [debug] Pushing command to appium work queue: [“element:click”,{“elementId”:“3”}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:click”,“params”:{“elementId”:“3”}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: click
info: [debug] Responding to client with success: {“status”:0,“value”:true,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element/3/click 200 98.232 ms - 76 {“status”:0,“value”:true,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:true}
info: → POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element/3/value {“id”:“3”,“value”:[“abc”]}
info: [debug] Pushing command to appium work queue: [“element:setText”,{“elementId”:“3”,“text”:“abc”,“replace”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”:“element:setText”,“params”:{“elementId”:“3”,“text”:“abc”,“replace”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: setText
info: [debug] [BOOTSTRAP] [debug] Using element passed in.
info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
info: [debug] [BOOTSTRAP] [debug] Text not cleared. Assuming remainder is hint text.
info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: abc
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:13,“value”:“Unknown error”}
info: [debug] Responding to client with error: {“status”:13,“value”:{“message”:“An unknown server-side error occurred while processing the command.”,“origValue”:“Unknown error”},“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← POST /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd/element/3/value 500 467.541 ms - 182
info: → DELETE /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd {}
info: Shutting down appium session
info: [debug] Pressing the HOME button
info: [debug] executing cmd: C:\androidSDK\platform-tools\adb.exe -s e08ddce17d73 shell “input keyevent 3”
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“shutdown”}
info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 10.063
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Responding to client with success: {“status”:0,“value”:null,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}
info: ← DELETE /wd/hub/session/0a7d4403-c54f-42a9-965a-ca668e6e89bd 200 1206.171 ms - 76 {“status”:0,“value”:null,“sessionId”:“0a7d4403-c54f-42a9-965a-ca668e6e89bd”}

As you are automating an android app, perhaps try to use the AndroidDriver instead of RemoteWebDriver, e.g.:

AppiumDriver<MobileElement> driver = new AndroidDriver<MobileElement>(new URL(“http://127.0.0.1:4723/wd/hub”), capabilities);

and instead of using WebElement, try MobileElement, e.g.

MobileElement email=driver.findElement(By.id(“email_field”));
email.click();
email.sendKeys(“abc”);

I was taking a look at some of my android test logs and noticed that the debug logs were slightly different around setText.
e.g., my logs:

info: [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
info: [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: setText
info: [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using element passed in: 22

Your logs:

info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: setText
info: [debug] [BOOTSTRAP] [debug] Using element passed in.

I’m curious if the lack of a specified element in the last line is causing the issue with setText.

What version of appium are you using?

i suggest to use better email.setValue(“xx”) or email.replaceValue(“xxx”) - it is working with Android also same as iOS.

Also pls mention your Appium and Java-client version

Hi BG,

I modified my script as per your feedback as shown below and while executing using TestNG it is returning an error.

Modified Script :

public class gopageSigninTest{

AppiumDriver driver;

@BeforeMethod	
public void setUp() throws MalformedURLException{		
//Set up desired capabilities and pass the Android app-activity and app-package to Appium		
DesiredCapabilities capabilities = new DesiredCapabilities();		
capabilities.setCapability("deviceName", "Redmi");		
capabilities.setCapability("platformVersion", "6.0"); 		
capabilities.setCapability("platformName", "Android");		
capabilities.setCapability("appPackage", "com.gopage.android.GoPageClientApp");	
// This package name of your app (you can get it from apk info app)	
capabilities.setCapability("appActivity","com.gopage.android.GoPageClientApp.activity.Splash"); 	
//Create RemoteWebDriver instance and connect to the Appium server	
//It will launch the GoPage App in Android Device using the configurations specified in Desired Capabilities	
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);	
		
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS );
}	
	
@Test	
public void signin() throws Exception{	
driver.findElement(By.id("email_field"));
System.out.println("-----1----");
Assert.assertTrue(driver.findElement(By.id("email_field")).isDisplayed(), "element is not displayed");
System.out.println("-----2----");
driver.findElement(By.id("password_field"));
System.out.println("-----3----");
Assert.assertTrue(driver.findElement(By.id("password_field")).isDisplayed(), "element is not displayed");
System.out.println("-----4----");
    MobileElement email= (MobileElement) driver.findElement(By.id("email_field"));	
email.click();
Thread.sleep(2000);
email.sendKeys("abc");
    }	      
	
@AfterMethod	    
public void closeApp() {	           
driver.quit();	     
}	
}

Result after Running via TestNG :

===============================================
Default test
Tests run: 0, Failures: 0, Skips: 0

===============================================
Default suite
Total tests run: 0, Failures: 0, Skips: 0

[TestNG] Time taken by org.testng.reporters.XMLReporter@506e6d5e: 17 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 0 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@566776ad: 0 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@39ba5a14: 33 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@5b464ce8: 66 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@35f983a6: 7 ms

Hi Alek and BG,

My Appium version is “1.4.13.1

Java-Client version is “5.0.0-BETA2

Also if I try to run using JUnit test then also it returns an error of “Java.lang.NullPointerException”

show us your TestNG XML file you trying to start :slight_smile:

Alek,

Please see the attachment

does not look bad. according to your logs it look like it does not start test itself

What I can do more to fix this issue?

can you share source somewhere maybe this helps to understand your issue…

Are you sure you are using the Test annotation from TestNG and not JUnit?
I wonder if that is causing the Test to not run.

Sharing the source code would help

I used Thread.sleep in my script and it worked fine.

Thanks a lot guys for your help. :slight_smile: