Bird
0
0

Which of the following is TRUE about the callback function in executeAsyncScript?

easy📝 Conceptual Q2 of 15
Selenium Java - JavaScriptExecutor
Which of the following is TRUE about the callback function in executeAsyncScript?
AIt is optional and can be omitted
BIt must be called to signal script completion
CIt automatically returns the page title
DIt is used to handle exceptions only
Step-by-Step Solution
Solution:
  1. Step 1: Role of callback in async scripts

    The callback function signals when the async script finishes execution.
  2. Step 2: Importance of calling callback

    If the callback is not called, the script will timeout and fail.
  3. Final Answer:

    It must be called to signal script completion -> Option B
  4. Quick Check:

    Callback must be called = true [OK]
Quick Trick: Always call callback to finish async script [OK]
Common Mistakes:
MISTAKES
  • Skipping callback call causing timeout
  • Assuming callback is optional
  • Thinking callback returns page title automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Java Quizzes