首页 > 解决方案 > 当我尝试使用 selenium 在日历小部件上单击日期时出现此错误

问题描述

当我尝试使用 selenium 在日历小部件上单击日期时出现此错误:

[JavaScript 错误:“b.elementFromPoint 不是函数”{file:“file:///tmp/anonymous3738058585112632092webdriver-profile/extensions/fxdriver@googlecode.com/components/synthetic-mouse.js”行:11130}]' [JavaScript 错误:“b.elementFromPoint 不是函数”{file:“file:///tmp/anonymous373805858

标签: selenium

解决方案


公共无效点击日期(){

    String minDate = "12";
    webDriverWait(2);

    List<WebElement> list = element(test).findElements(By.tagName("td"));
    for(WebElement col : list){
        System.out.println(col.getText());
        if(col.getText().trim().equals(minDate)){

        col.click();
        }
    }

}

这里的测试包含 By test = By.className("bs-datepicker-body");


推荐阅读