Selenium Testing Framework Selenium Grid & Parallel Testing 1 — Questions and Answers
Question 1: What is the primary purpose of Selenium Grid?
- To write test scripts faster
- To run tests in parallel across multiple machines and browsers (Correct answer)
- To generate HTML test reports
- To record browser interactions
Correct answer: To run tests in parallel across multiple machines and browsers
Selenium Grid enables distributed test execution across multiple machines and browsers simultaneously to reduce total test run time.
Question 2: In Selenium Grid architecture, which component distributes test sessions to nodes?
- Node
- Hub (Correct answer)
- Router
- Session Map
Correct answer: Hub
The Hub acts as a central server that receives test requests and routes them to available Grid nodes.
Question 3: Which Selenium Grid version introduced a fully distributed, standalone architecture without a separate Hub process?
- Grid 2
- Grid 3
- Grid 4 (Correct answer)
- Grid 1
Correct answer: Grid 4
Selenium Grid 4 introduced a fully distributed architecture that can run as standalone, hub-node, or fully distributed deployments.
Question 4: What URL path is used to access the Selenium Grid console by default on a hub running at localhost:4444?
- /grid/console (Correct answer)
- /console
- /status
- /grid/api/hub
Correct answer: /grid/console
The Selenium Grid console is accessible at http://localhost:4444/grid/console for monitoring registered nodes and sessions.
Question 5: When configuring a RemoteWebDriver for Selenium Grid, which object specifies the target browser and platform?
- WebDriver options
- DesiredCapabilities / Browser Options (Correct answer)
- GridConfig
- NodeConfig
Correct answer: DesiredCapabilities / Browser Options
DesiredCapabilities (or the newer Browser Options classes like ChromeOptions) tell the Grid which browser and platform to match the test to a node.
Question 6: Which command registers a Selenium Grid 4 Node to connect to a Hub at 192.168.1.10:4444?
- java -jar selenium.jar node --hub http://192.168.1.10:4444 (Correct answer)
- java -jar selenium.jar node --grid-url http://192.168.1.10:4444
- java -jar selenium.jar register --hub 192.168.1.10:4444
- selenium-node start --host 192.168.1.10
Correct answer: java -jar selenium.jar node --hub http://192.168.1.10:4444
In Grid 4 the node is started with `java -jar selenium.jar node --hub <hub-url>` to register with the specified hub.
What is the primary purpose of Selenium Grid?