Text field clear automatically after entering the value as sendkeys



  • I tried to login on my mobile webbrowser. After passing my username as string, it clears automatically.

    My code is

    loginId.click(); 
    loginId.sendKeys(userName); 
    

    The script fails only with the mobile browser. The login is a light box pop up.

    I also tried javascript executor and actions. Nothing worked.



  • This happens because of your application behavior. You can try with below code:

    Actions action =new Actions(driver);
    driver.findElement(By.xpath("")).sendkeys("textvalue");
    action.sendkeys("Keys.TAB");
    

Log in to reply
 

Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2