JavascriptExecutor Selenium WebDriver

时间:2015-10-01 19:23:38

标签: javascript java selenium-webdriver

我无法在页面上执行doFilterOffer()功能,这是以下错误missing ; before statement,下面的语法有什么问题?

    if (driver instanceof JavascriptExecutor) {

        ((JavascriptExecutor) driver).executeScript("Function doFilterOffer();", "click");
    }

1 个答案:

答案 0 :(得分:1)

您应该删除Function字词:

((JavascriptExecutor) driver).executeScript("doFilterOffer();", "click");