How to maintain Selenium Grid?
I have many VMs which are used as part of Grid. Some as RC and some as Hub. Due to the large number of VMs that is being used, it is a big task to maintain the grid now. To change the RC to point to a different hub, I will have to
login to that machine
kill the current RC
run the java command again with a different hub URL
Yes, I can use a batch script to restart all the machines. But what if I just want to change just one machine?
Is it possible to create an application 开发者_StackOverflow中文版using JAVA RMI which can run the required commands to kill, start, restart the RCs or Hub? Has anyone ever tried to create such an application?
you should have a look at selenium grid2.0. It's been designed with exactly what you ask in mind. You can create your own proxy extending either the selenium1 ( RC ) or selenium2 ( webdriver protocol ), and implement a list of interfaces that will allow to react to certain events.
You could for instance :
have one unique hub controlling all the nodes and refine the routing by implementing the matcher.
update the grid console to have some "reconfigure node" functionality directly there
add some rules on each node, for instance restart the VM and the server within it automatically every X test or when a specific event is detected.
I wouldn't start a RMI based solution. If you have VMs, you should have access to the VM API for the solution you choose, and you can use that to revert to a known clean state and restart from there each time. That will ensure you don't have left over crashed browsers and things like that.
thanks, François
i know this is old question. How about setting puppet on your VM so you just need to specify one config on master.
精彩评论