Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9094589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T23:23:04+00:00 2026-06-16T23:23:04+00:00

I want to wait until a js script return true, the code I am

  • 0

I want to wait until a js script return true, the code I am using is not compiling and throwing error

is not abstract and does not override abstract method apply(Object) in Function

here is the code

WebDriverWait wait = new WebDriverWait(driver, 10);
        boolean isFound = wait.until(new ExpectedCondition(){ //here ERROR
            public Boolean apply(WebDriver d){
                JavascriptExecutor js = (JavascriptExecutor) d;
                return (Boolean) js.executeScript("return true");
            }
        });

I tried to copy code from
http://www.tarnowski.se/2011/09/11/converting-selenium-waitforcondition-to-webdriverwait/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T23:23:06+00:00Added an answer on June 16, 2026 at 11:23 pm

    instead of

            public Boolean apply(WebDriver d){
                JavascriptExecutor js = (JavascriptExecutor) d;
                return (Boolean) js.executeScript("return true");
            }
    

    try

            public Boolean apply(Object d){
                JavascriptExecutor js = (JavascriptExecutor) d;
                return (Boolean) js.executeScript("return true");
            }
    

    The Function class/interface expects a method with this signature in its subclasses that you create.

    If there’s a raw types warning, perhaps new ExpectedCondition<WebDriver>(){ ... is what you’re expected to do?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to wait until internet comes so i created a loop with InternetGetConnectedState
want to ask user to input something but not want to wait forever. There
I need to wait in a script until a certain number of conditions become
I saw here a solution, but i don't want wait until the key is
What's the best way to wait in a Bash script, until the result of
I want to run multiple threads simultaneously, and wait until all of them are
I want to know how to make expect command in expect script to wait
NSOperationQueue has waitUntilAllOperationsAreFinished , but I don't want to wait synchronously for it. I
I want user to wait for specified time(4seconds) to get connected to server. If
I have implemented ReaderWriterLockSlim, Now i don't want it to wait at the lock.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.