While automating login process with appium the password and username are entred in the same field of username

前端 未结 3 636
南笙
南笙 2021-01-16 20:51

Although the test is clear and simple i\'m always facing the same problem while tring to send keys (username; password) the password field is written in place of username !

相关标签:
3条回答
  • 2021-01-16 21:14

    This is strange issue. But Here is the solution for this.

    public void hideKeyBoard()
    {
        try{driver.hideKeyboard();}
        catch(Exception e){}
    }
    

    Use above method to hide keyboard

        driver.findElement(By.id("input_email")).click();
    
        driver.getKeyboard().sendKeys("e@e.emma.com");
    
        hideKeyboard();
    
        driver.findElement(By.id("input_password")).click();
    
        hideKeyboard();
    
        driver.getKeyboard().sendKeys("00000000");
    

    Hope this helps :)

    0 讨论(0)
  • 2021-01-16 21:15

    Finally i have resolved this issue by adding to my code :

    driver.hideKeyboard();
    

    The issue was because the keyboard is hiding the field of password !

    0 讨论(0)
  • 2021-01-16 21:25

    This could be timing issue, just for test try to put Thread.sleep(5000); after you set username and before you try to set password and see what happens.

    It is strange but it happend in my case, sometimes my firefoxdriver wrote in wrong field even if all fields were unique and successfully found. Small time span between two sendKeys() calls solved the issue. I wasn't using sleeps, simple verification if correct text was written in the field between these 2 calls was enough time so that next sendKeys() writes in correct field.

    0 讨论(0)
提交回复
热议问题