Selenium-server is only a separate server in selenium1, and selenium-server in selenium2 contains allProgram.
The package name is "selenium-server-standalone-X.XX.XXX.jar", which is described below.
Selenium-server startup Method
Start independently[Interactive, non-interactive ],Start as hub,Start as node[For hub]
Start an independent RC Server
Java-jar selenium-server-standalone.jar
Parameter description:
No parameter:
If no parameter is specified, the default parameters and ports are used. After startup, the default request and call address are http: // localhost: 4444/WD/hub; at this time, it is used as an independent remote RC Server to receive and execute commands (namely, selenese protocol command, HTTP-based protocol) sent locally. Of course, the script for sending commands can be either a local machine or another machine. In this case, you can access http: // localhost: 4444/WD/hub through a browser to view Real-time client registration information.
We can use the followingCodeTo communicate with RC:
Desiredcapabilities iedesiredcap = desiredcapabilities. internetexplorer (); WD = new remotewebdriver (new URL ("http: // localhost: 4444/WD/hub"), iedesiredcap); WD. get ("http://www.google.com"); thread. sleep (1, 1200); system. out. println (">>>>>>>" + WD. getcurrenturl (); WD. quit ();
Start an independent interactive RC Server
Java-jar selenium-server-standalone.jar-interactive
Parameter description:
-Interactive:
Specify the startup mode as interactive, that is, you can directly enter the selenese command on the startup command line to control the browser registered on the RC. In the first non-interactive case, you can only program to communicate with RC and send commands to complete the test operation, so this mode is more like the debugging mode.
Selenium also provides other optional parameters for the preceding two startup modes to specify the configuration information for independent startup. For example:
-Port xxxx
Used to set the listener port for RC startup.
-Timeout xxxx
Set the timeout time (in seconds) for maintaining client connection after RC is started.
-Browsertimeout xxxx
Sets the timeout time for viewing without response after RC is started, in seconds
In addition, many other optional parameters can be specified. For more information, see the command line help;
Java-jar selenium-server.jar-H