[CSAT JS] Certified Selenium Automation Tester using JavaScript Certification Exam Guide, Exams of Technology

This exam guide prepares candidates for browser automation using Selenium with JavaScript, covering scripting, asynchronous execution, test reliability, and cross-browser testing. The guide emphasizes modern testing practices and exam-aligned scenarios.

Typology: Exams

2025/2026

Available from 02/11/2026

shilpi-jain-3
shilpi-jain-3 🇮🇳

2.5

(11)

80K documents

1 / 25

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
[CSAT JS] Certified Selenium Automation
Tester using JavaScript Certification Exam
Guide
**196.** Which Selenium WebDriver command retrieves the current window’s
**handle**?
A) `driver.getWindowHandle()`
B) `driver.getCurrentWindow()`
C) `driver.windowHandle()`
D) `driver.manage().window().handle()`
**Answer:** A
**Explanation:** `getWindowHandle()` returns a string uniquely identifying the
active window.
---
**197.** In a **Docker-based Selenium Grid**, which flag limits the **maximum
number of concurrent sessions** a node may run?
A) `-maxSession`
B) `-maxInstances`
C) `-concurrentSessions`
D) `-sessionLimit`
**Answer:** B
**Explanation:** `-maxInstances` (or `maxInstances` in the node JSON) caps
parallel sessions per node.
---
**198.** Which of the following **JavaScript** statements correctly **awaits** a
Selenium promise **and** catches any rejection without using `try…catch`?
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19

Partial preview of the text

Download [CSAT JS] Certified Selenium Automation Tester using JavaScript Certification Exam Guide and more Exams Technology in PDF only on Docsity!

Tester using JavaScript Certification Exam

Guide

196. Which Selenium WebDriver command retrieves the current window’s handle? A) driver.getWindowHandle() B) driver.getCurrentWindow() C) driver.windowHandle() D) driver.manage().window().handle() Answer: A Explanation: getWindowHandle() returns a string uniquely identifying the active window.

197. In a Docker-based Selenium Grid, which flag limits the maximum number of concurrent sessions a node may run? A) -maxSession B) -maxInstances C) -concurrentSessions D) -sessionLimit Answer: B Explanation: -maxInstances (or maxInstances in the node JSON) caps parallel sessions per node.

198. Which of the following JavaScript statements correctly awaits a Selenium promise and catches any rejection without using try…catch?

Tester using JavaScript Certification Exam

Guide

A) await promise.catch(err => console.error(err)); B) await promise.then(() => {}, err => console.error(err)); C) await promise; (no catch needed) D) await promise.finally(() => console.log('done')); Answer: A Explanation: Appending .catch to the promise handles rejection while still using await.

199. When using Mocha with parallel mode, which option must be set to avoid race conditions on shared resources? A) --parallel B) --jobs 1 C) --no-warnings D) --delay Answer: B Explanation: Setting --jobs 1 forces serial execution for tests that share state, preventing race conditions.

200. Which CSS selector will match an element with both class="btn primary" and data-action="save"? A) .btn.primary[data-action="save"] B) button.btn[data-action=save]

Tester using JavaScript Certification Exam

Guide

Answer: A Explanation: git tag creates a lightweight (non-annotated) tag.

203. Which Selenium method returns a Promise that resolves to the page source of the current page? A) driver.getPageSource() B) driver.getSource() C) driver.pageSource() D) driver.source() Answer: A Explanation: getPageSource() returns a promise containing the HTML markup.

204. When using await inside an async Mocha hook, what must be returned to Mocha so it knows when the hook finishes? A) Nothing – Mocha automatically detects await. B) The resolved value of the awaited promise. C) The promise itself (by returning it). D) A callback invoking done(). Answer: C Explanation: An async function returns a promise; Mocha waits for that promise to settle.

Tester using JavaScript Certification Exam

Guide

205. Which npm script command runs Mocha with the spec reporter and enables watch mode? A) "test": "mocha --reporter spec --watch" B) "test": "mocha -r spec -w" C) "test": "mocha --spec --watch" D) "test": "mocha --reporter=spec -watch" Answer: A Explanation: --reporter spec selects the reporter; --watch tells Mocha to re-run on file changes.

206. In Selenium Grid, what does the maxSession property on the hub control? A) Maximum total sessions the hub can accept across all nodes. B) Maximum sessions per node. C) Maximum parallel browser instances per session. D) Maximum number of browsers the hub can register. Answer: A Explanation: maxSession caps the total concurrent sessions the hub will schedule.

Tester using JavaScript Certification Exam

Guide

209. When using Docker Compose to spin up a Selenium Hub and Node, which service name is typically used to reference the hub from a node’s -hub argument? A) hub B) selenium-hub C) grid-hub D) seleniumhub Answer: B Explanation: The official Docker images use the service name selenium-hub in the compose file.

210. Which Git workflow command creates a pull request on GitHub from a feature branch feature/login after pushing it? A) git push origin feature/login && gh pr create --base main --head feature/login B) git request-pull origin/main feature/login C) git pull-request feature/login D) git pr open feature/login Answer: A Explanation: gh pr create (GitHub CLI) creates a PR after the branch is pushed.

211. In Jest, which matcher verifies that a mock function was called exactly twice?

Tester using JavaScript Certification Exam

Guide

A) expect(mockFn).toHaveBeenCalledTimes(2); B) expect(mockFn).toBeCalled(2); C) expect(mockFn).toHaveBeenCalled(2); D) expect(mockFn).toBeCalledTimes(2); Answer: A Explanation: toHaveBeenCalledTimes checks the exact call count.

212. Which Selenium method clears the text of an `` element? A) element.clear() B) element.setText('') C) element.sendKeys('') D) element.reset() Answer: A Explanation: clear() empties the value of form controls.

213. Which npm package provides a fluent API for drag-and-drop actions on Selenium WebDriver elements? A) webdriverio B) selenium-actions C) wdio-dragdrop D) selenium-dnd

Tester using JavaScript Certification Exam

Guide

Explanation: Fetch obtains the remote, then rebase reapplies local commits on top of the remote tip, avoiding a merge commit.

216. Which JavaScript operator strictly checks both type and value equality? A) == B) === C) != D) !== Answer: B Explanation: === performs a strict comparison without type coercion.

217. In Selenium, which WebDriver command retrieves the current URL of the browser? A) driver.getCurrentUrl() B) driver.getUrl() C) driver.currentUrl() D) driver.url() Answer: A Explanation: getCurrentUrl() returns a promise that resolves to the URL string.

Tester using JavaScript Certification Exam

Guide

218. Which Mocha hook runs once after all test suites have finished? A) after() B) afterEach() C) afterAll() (does not exist) D) finally() (does not exist) Answer: A Explanation: after() executes a single time after the entire test run.

219. Which Docker command builds an image from a Dockerfile located in the current directory and tags it selenium-node:4.1? A) docker build -t selenium-node:4.1 . B) docker build selenium-node:4.1 . C) docker create -t selenium-node:4.1 . D) docker image build selenium-node:4.1 . Answer: A Explanation: docker build -t tags the image.

Tester using JavaScript Certification Exam

Guide

C) git remote show origin D) git ls-remote --heads origin Answer: A Explanation: -r lists only remote-tracking branches.

223. Which JavaScript feature cannot be used in a Node version < 10? A) async/await B) let/const C) Arrow functions (=&gt;) D) Template literals (`text`) Answer: A Explanation: async/await arrived in Node 8 behind a flag and became stable in Node 10.

224. Which Selenium command retrieves the value of an element’s attribute placeholder? A) element.getAttribute('placeholder') B) element.getPlaceholder() C) element.attribute('placeholder') D) element.prop('placeholder')

Tester using JavaScript Certification Exam

Guide

Answer: A Explanation: getAttribute works for any attribute.

225. When using Jenkins, which pipeline step archives test result XML files for later publishing? A) archiveArtifacts artifacts: '**/target/*.xml' B) junit '**/target/*.xml' C) publishHTML target: '**/target/*.xml' D) publishJUnit '**/target/*.xml' Answer: A Explanation: archiveArtifacts stores the files; a later junit step can consume them.

226. Which Git command rewrites the last two commits while preserving the changes? A) git rebase -i HEAD~2 B) git reset --soft HEAD~2 &amp;&amp; git commit C) git amend HEAD~2 D) git cherry-pick -n HEAD~2 Answer: A Explanation: Interactive rebase (-i) on the last two commits lets you edit, reorder, or squash them.

Tester using JavaScript Certification Exam

Guide

229. In Jest, which function creates a mock function that can record calls? A) jest.fn() B) jest.mock() C) jest.spyOn() D) jest.createMock() Answer: A Explanation: jest.fn() returns a new mock function.

230. Which Git command removes a remote branch named feature/old from origin? A) git push origin --delete feature/old B) git branch -D feature/old C) git remote rm feature/old D) git push origin :feature/old Answer: A Explanation: git push origin --delete deletes the remote branch.

231. Which Selenium command waits for the page title to contain the word “Dashboard”?

Tester using JavaScript Certification Exam

Guide

A) driver.wait(until.titleContains('Dashboard'), 10000); B) driver.wait(until.titleIs('Dashboard'), 10000); C) driver.wait(() =&gt; driver.getTitle().includes('Dashboard'), 10000); D) driver.wait(until.titleMatches(/Dashboard/), 10000); Answer: A Explanation: until.titleContains checks for a substring in the title.

232. Which Docker option binds the host’s port 4444 to the container’s Selenium Hub port 4444? A) -p 4444:4444 B) --publish 4444 C) -port 4444:4444 D) --expose 4444 Answer: A Explanation: -p host:container publishes the container port to the host.

233. Which Mocha command-line flag disables colors in the output? A) --no-colors B) --color false C) --disable-colors D) --monochrome

Tester using JavaScript Certification Exam

Guide

236. Which Selenium method retrieves the text of a WebElement? A) element.getText() B) element.text() C) element.innerText() D) element.getContent() Answer: A Explanation: getText() returns the visible text.

237. In Jenkins, which pipeline step runs a Shell command on a Linux agent? A) sh 'npm test' B) bat 'npm test' C) script { npm test } D) run 'npm test' Answer: A Explanation: sh executes a shell script on Unix agents.

238. Which npm package provides a fluent API for asserting HTTP responses (e.g., status code, body)?

Tester using JavaScript Certification Exam

Guide

A) supertest B) chai-http C) axios-mock-adapter D) request-promise Answer: B Explanation: chai-http extends Chai with HTTP request assertions.

239. Which Git command reverts a single commit identified by hash a1b2c3d without creating a new commit? A) git revert --no-commit a1b2c3d B) git reset --hard a1b2c3d C) git checkout a1b2c3d D) git cherry-pick -n a1b2c3d Answer: A Explanation: git revert --no-commit undoes the changes but leaves them staged for a later commit.

240. Which Selenium command switches the driver’s context to a frame identified by a WebElement frameEl? A) driver.switchTo().frame(frameEl) B) driver.switchTo().frameElement(frameEl)