Problem with Javascriptexecutor Selenium Webdriver

Asked

Viewed 113 times

0

I can’t perform the function doFilterOffer() on the page, it gives the following error

Missing ; before statement

, what’s the problem with this syntax below?

    if (driver instanceof JavascriptExecutor) {

        ((JavascriptExecutor) driver).executeScript("Function doFilterOffer();", "click");
    }
  • Could you put a larger part of the code? The error is indicated before the if or after entering it?

  • @mauriciocaserta ja solved, thank you very much.

1 answer

0

The error was in using the parameter Function

The correct is:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.