2018-02-06 chromeDriver sendkeys方法提示:cannot focus element

测试qq邮箱发件用例时,收件人一框的元素能够找到并click,但是sendkeys一直报错,后来网上找到一个方法:
Actions actions = new Actions(driver);
actions.moveToElement(sendMan);
actions.click();
actions.sendKeys("[email protected]");
actions.build().perform();
故将其抽象为Page类的方法,其自类均可调用,

public static void actionSendKays (WebDriver driver,WebElement     
    webelement,String senkeys) {
    Actions actions = new Actions(driver);
    actions.moveToElement(webelement);
    actions.click();
    actions.sendKeys(senkeys);
    actions.build().perform();
}

你可能感兴趣的:(2018-02-06 chromeDriver sendkeys方法提示:cannot focus element)