Selenium grid not working without chromedriver local install
Selenium grid not working without chromedriver local install
I ran the following commands to get my selenium grid / hub up and running:
hub: java -jar selenium-server-standalone-3.14.0.jar -role hub
java -jar selenium-server-standalone-3.14.0.jar -role hub
node: java -jar selenium-server-standalone-3.14.0.jar -role node -hub http://localhost:4444/grid/register
java -jar selenium-server-standalone-3.14.0.jar -role node -hub http://localhost:4444/grid/register
when I check the hub console, I see that my webdriver is registered, and ready to use...
I connected to the hub via:
driver = webdriver.Remote(
command_executor='http://localhost:4444/wd/hub',
desired_capabilities=DesiredCapabilities.CHROME)
and it connects fine...however, if i don't have chromedriver (like if I was to do it w/o grid) downloaded and installed in $PATH, the application fails.
Is this normal? I was under the impression, the whole point of selenium-grid and all this remote logic was to ensure that the individual drivers don't need to be installed on the "client" machine.
@sers so is my logic incorrect? " I was under the impression, the whole point of selenium-grid and all this remote logic was to ensure that the individual drivers don't need to be installed on the "client" machine"
– nate
Aug 24 at 15:17
2 Answers
2
yes its mandatory to install browser and its compatible driver on client machine
Below image will clear how it works
Selenium don't controls browser, driver do. Selenium with hub role is server and balancer to selenium with node role, and node speaks with driver.
You need selenium jar and drivers on each client machine which will speaks with hub.
How it works with hub:
⇄ node ⇄ driver ⇄ browser (same machine)
code ⇄ hub ⇄ node ⇄ driver ⇄ browser (another machine)
⇄ node ⇄ driver ⇄ browser (another machine)
thanks so much for your help! So if i understand correctly, Host A: Contains Hub, Server 1,2,3: Nodes My PC: NightwatchJS / selenium.py etc etc. My PC connects to hub, which in turn speak to the nodes on server 1,2,3. and the nodes are the ones doing all the heavy lifting... But my PC needs the chromedriver? (chromedriver.chromium.org/downloads)
– nate
Aug 24 at 22:15
If your PC is not node or you don't run test locally without hub then your PC not need driver. Server 1,2,3 need driver and selenium runs as node and connected to the hub. Also Host A can be both hub and node
– sers
Aug 24 at 22:20
Ah that explains it, cheers mate!
– nate
Aug 24 at 22:36
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Normal. You don’t need $PATH if selenium jar and drivers in the same folder as I remember
– sers
Aug 24 at 14:28