java -jar selenium-server.jar -role hub -> Option A
Quick Check:
Hub starts with '-role hub' flag [OK]
Hint: Hub uses '-role hub' flag in command [OK]
Common Mistakes:
Using '-role node' instead of '-role hub'
Incorrect flag order or spelling
Using '-start' or '-node start' which are invalid
3. Given the following Selenium Grid setup code snippet, what will be the output when the test runs?
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
hub_url = "http://localhost:4444/wd/hub"
driver = webdriver.Remote(command_executor=hub_url, desired_capabilities=DesiredCapabilities.CHROME)
print(driver.capabilities['browserName'])
driver.quit()
medium
A. safari
B. firefox
C. edge
D. chrome
Solution
Step 1: Analyze the desired capabilities used
The code requests a Chrome browser by using DesiredCapabilities.CHROME.
Step 2: Understand the output of driver.capabilities['browserName']
This returns the name of the browser the remote driver is connected to, which should be 'chrome'.
Final Answer:
chrome -> Option D
Quick Check:
DesiredCapabilities.CHROME = 'chrome' output [OK]
Hint: DesiredCapabilities.CHROME means browserName is 'chrome' [OK]
Common Mistakes:
Assuming default browser is Firefox
Confusing capability keys
Not quitting driver causing errors
4. You started a Selenium Grid node with the command: java -jar selenium-server.jar -role node -hub http://localhost:4444/grid/register But the node is not registering with the hub. What is the most likely cause?
medium
A. The hub URL is incorrect or the hub is not running
B. The node command should use '-role hub' instead of '-role node'
C. The selenium-server.jar file is corrupted
D. The node must be started before the hub
Solution
Step 1: Check the hub URL and hub status
If the node cannot register, often the hub URL is wrong or the hub is not running.
Step 2: Verify command correctness
The command uses '-role node' correctly; the jar file corruption or start order is less common causes.
Final Answer:
The hub URL is incorrect or the hub is not running -> Option A
Quick Check:
Node needs correct hub URL and running hub [OK]
Hint: Check hub URL and hub running status first [OK]
Common Mistakes:
Mixing up node and hub roles in commands
Assuming jar file corruption without evidence
Starting node before hub is usually okay
5. You want to run tests on multiple browsers simultaneously using Selenium Grid. Which setup correctly describes how the hub and nodes should be configured?
hard
A. Multiple nodes running on the same machine without a hub
B. One hub running on a central machine, multiple nodes registered with different browsers on different machines
C. One node running multiple hubs, each controlling a browser
D. Multiple hubs running on different machines, each with one node registered
Solution
Step 1: Understand Selenium Grid architecture
The hub acts as a central controller, and nodes register to it with different browsers.
Step 2: Identify correct multi-browser setup
Multiple nodes on different machines with different browsers register to one hub to run tests in parallel.
Final Answer:
One hub running on a central machine, multiple nodes registered with different browsers on different machines -> Option B
Quick Check:
Single hub, multiple nodes with browsers [OK]
Hint: Hub central, nodes distributed with browsers [OK]
Common Mistakes:
Thinking multiple hubs are needed for parallel tests
Confusing roles of hub and node
Running nodes without a hub
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.