getting cannot focus element in chrome and edge using java/selenium

后端 未结 7 2241
南笙
南笙 2020-12-06 05:26

I am getting a cannot focus element error when running my test in chrome and edge in FF it works fine. I have tried posted resolutions but to no avail. I am not sure wha

7条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 06:03

    sendkeys method is the problem as per the stack trace.

    at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:121)
    

    Please try Actions class to first focus on the element then send required keys.

    Actions actions = new Actions(driver);
    actions.moveToElement(element);
    actions.click();
    actions.sendKeys("SOME DATA");
    actions.build().perform();
    

提交回复
热议问题