Submitted by administrator on
See the following page for some clever code for finding an available port number in Windows to start an instance of the selenium server. This is handy when you are trying to start multiple instances of selenium and need port numbers that are not in use.