Password getting appended in user id field of facebook app using appium!

Hello,

I am running to this issuw where i am trying to automating the facebook login procedure using appium on eclipse.

This is my script
package com.appium.facebook.androiduiselector;

import io.appium.java_client.android.AndroidDriver;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;

import org.junit.Test;
import org.openqa.selenium.remote.DesiredCapabilities;

public class FacebookLoginTest {

@Test

public void testLoginFB() throws MalformedURLException, InterruptedException
{
DesiredCapabilities capabilities = new DesiredCapabilities() ;
capabilities.setCapability(“automationName”,“Appium”);
capabilities.setCapability(“platformnName”,“Android”);
capabilities.setCapability(“platformVersion”,“5.1.1”);
capabilities.setCapability(“deviceName”,“Nexus 6” );
capabilities.setCapability(“app”,“C:\Users\Jenny\Downloads\facebook.apk”);
capabilities.setCapability(“appPackage”,“com.facebook.katana”);
capabilities.setCapability(“appActivity”, “com.facebook.katana.LoginActivity”);
AndroidDriver driver = new AndroidDriver (new URL (“http://127.0.0.1:4723/wd/hub”), capabilities) ;
driver.manage().timeouts().implicitlyWait(100,TimeUnit.SECONDS);

driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.facebook.katana:id/login_username\")").sendKeys("[email protected]");
driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.facebook.katana:id/login_password\")").sendKeys("xxxxx");
driver.findElementByAndroidUIAutomator("new UiSelector().resourceId(\"com.facebook.katana:id/login_login\").text(\"LOG IN\")").click();
Thread.sleep(8000);

}

}

Eclipse console doesnt show any sign of error and also appium logs.
When i run this script appium is appending password in user fileld and the facebookin login doent happen ,i dont know previously after the script was corrected it ran fine it was able to login to facebook.
Please help.

try :
1 add between sendKeys e.g.

driver.sendKeyEvent(AndroidKeyCode.ENTER);

2 or tap on field forcibly in code before sending text.

sorry i entered
driver.sendKeyEvent(AndroidKeyCode.ENTER);
but still it didnt help, it looks very weird, what its doing exactly ,appium enters the email in the user id field and then erases two alphabets in user filed itself and then append passowrd there .
which is really really surprising me to see :confused:

try click on element before send

Thanks it helped ,thanks a ton :slight_smile: