How to Use selenium-RC

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.