← Quiz: Web Elements: all 10 questions
Quiz: Web Elements · Question 10 of 10
When should you use JavascriptExecutor, for example to scroll an element into view?
When should you use JavascriptExecutor, for example to scroll an element into view?
- A.For every click, because it is faster
- B.Only when normal WebDriver actions cannot do the job
- C.To avoid writing assertions
- D.Never; it is not part of Selenium
Answer & explanation
Correct answer: Only when normal WebDriver actions cannot do the job
JavaScript clicks skip real user behaviour, so they can hide bugs a user would hit.
Can you get the rest right without peeking?
Take the timed Quiz: Web Elements quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →