问题
I started with the selnium stand alone server setup
java -jar selenium-server-standalone-2.32.0.jar
Which allowed to me successfully connect and run my tests, with multiple browsers running at a time.
What is the difference when i use the following set-up, as a hub...
java -jar selenium-server-standalone-2.42.2.jar -role hub
and an attached node...
java -jar .\selenium-server-standalone-2.42.2.jar -role node -hub http://localhost:4444/grid/register
which also seemed to work the same.
Is the hub/node set-up my best option just purely for configuration flexibility?
回答1:
Hub/Node setup gives you the flexibility to run tests on different machines and different environment. Sometimes you may want to a run test in different browsers or different version of browsers ex on IE 6 to 10. In such cases you can setup multiple nodes with different versions of IE. While on single machine you cant have multiple versions of IE.
Also with Grid you can run multiple tests in parallel across different nodes. If your script doesn't demand such environments or parallel execution you can use single machine.
回答2:
Hub/Node is useful if you need to run tests on a variety of operating systems/browser configurations. For instance you could have Nodes running XP, Windows 7, Windows 8.1. Each of these machines could also be running a different version of each internet browser (if you need to support IE8 on Windows XP for instance). This allows you to test around a wide variety of configurations. I've found that running tests on my local machine is generally sufficient, but it really depends on the needs of your application.
For further reading check out:
http://www.guru99.com/introduction-to-selenium-grid.html and https://saucelabs.com/
Hope this helps!
来源:https://stackoverflow.com/questions/24303909/what-is-the-difference-between-running-the-selenium-standalone-server-and-hub-no