Selenium sendKeys are not sending all characters

前端 未结 7 1808
面向向阳花
面向向阳花 2021-02-02 15:29

I\'m using Java, Selenium, and Chrome for test automation. Our developers recently upgraded our UI from AngularJS to Angular2 (not sure if that matters). But since then, sendKey

7条回答
  •  我在风中等你
    2021-02-02 16:13

    This is due to a bug in Angular apps. Workaround is to put a sleep function.

    public void setText(By element, String text) {
        sleep(100); // Angular version < 2 apps require this sleep due to a bug
        driver.findElement(element).clear();
        driver.findElement(element).sendKeys(text);
    }
    

提交回复
热议问题