Share
Go down
katuri.babu8@gmail.com
Posts : 1
Join date : 2013-12-19

In Selenium RC wat is the Need of Running Selenium Server On Custom port

on Thu Dec 19, 2013 5:19 pm
The default selenium port was 4444

but by using the 

RemoteControlConfiguration  rcc=new RemoteControlConfiguration();
rcc.setPort(1234);  // This is RCC  class method . here we pass the 4 digits


  My Question is wat is the use of Custom Port 
ravinderreddy
Posts : 6
Join date : 2012-11-10
Age : 31
Location : Hyderabad/Mumbai

Re: In Selenium RC wat is the Need of Running Selenium Server On Custom port

on Mon Dec 30, 2013 1:26 pm
When running selenium server often it happens that it can’t start with the following error:
“Selenium is already running on port 4444. Or some other service is.”

This happens because Selenium uses the 4444 port as its default and if you already started selenium or some other application is using that port Selenium will be prevented from using the same port.

static int port=4444;
          try {
             ServerSocket serverSocket = new ServerSocket(port);
             //Checking whether 4444 is closed or not
             if(!serverSocket.isClosed())
                port=5555;//Or whatever port you like
             //Now start selenium server
             RemoteControlConfiguration rcc = new RemoteControlConfiguration();
             rcc.setPort(port);
             SeleniumServer server = new SeleniumServer(false, rcc);
             server.start();  }

          catch(Exception e){
            e.printStackTrace(); }
Back to top
Permissions in this forum:
You cannot reply to topics in this forum