Selenium / Quiz

JavascriptExecutor: Power Tool, Sharp Edges

executeScript can click anything, scroll anywhere, and read any value. It can also quietly turn your UI test into a test of nothing. Know both halves.

Difficulty
Medium
Format
Quiz
Points
150
Estimate
9 min

// MISSION BRIEF

Your Mission

Someone on the team discovered executeScript and now every click in the suite is a JS click. The suite is green and the app is broken for real users. Time to relearn the tool properly.

Six questions on the executor: mechanics, return types, async, and when NOT to use it. Speed bonus active.

// FIRST CONTACT

Battle teaser

In executeScript("arguments[0].scrollIntoView(true);", element), arguments[0] refers to:

  1. AThe WebElement passed after the script, Selenium serializes it into the corresponding DOM node in the page
  2. BThe first element on the page
  3. CThe window object
  4. DThe driver instance
Answers, scoring, hints, and the full battle stay sealed.

// SKILL TAGS

seleniumjavascript-executoranti-patternswebui-automation