Thursday, 2 October 2014

Selenium Remote Control
Predefined Functionality:
Data-Driven Testing:
Compatibility: 
Conclusion - Selenium RC: 
Selenium Remote Control (RC) is a server, written in Java, that accepts commands for the browser via HTTP. RC makes it possible to write automated tests for a web application in any programming language, which allows for better integration of Selenium in existing unit test frameworks. To make writing tests easier, Selenium project currently provides client drivers for PHPPythonRuby.NETPerl and Java. The Java driver can also be used with JavaScript (via the Rhino engine). A new instance of selenium RC server is needed to launch html test case - which means that the port should be different for each parallel run.[citation needed] However, for Java/PHP test case only one Selenium RC instance needs to be running continuously.[citation needed]
Selenium Remote Control was a refactoring of Driven Selenium or Selenium B designed by Paul Hammant, credited with Jason as co-creator of Selenium. The original version directly launched a process for the browser in question, from the test language of Java, .Net, Python or Ruby. The wire protocol (called 'Selenese' in its day) was reimplemented in each language port. After the refactor by Dan Fabulich, and Nelson Sproul (with help from Pat Lightbody) there was an intermediate daemon process between the driving test script, and the browser. The benefits included the ability to drive remote browsers, and the reduced need to port every line of code to an increasingly growing set of languages. Selenium Remote Control completely took over from the Driven Selenium code-line in 2006. The browser pattern for 'Driven'/'B' and 'RC' was response/request, which subsequently became known as Comet.

With the release of Selenium 2, Selenium RC has been officially deprecated in favor of Selenium WebDriver.

Selenium RC:

Selenium RC offers a more flexible but also more complex approach to create and run browser tests. With Selenium RC it is possible to run tests inside every JavaScript compatible browser using a wide range of programming languages.

Installation: 

The installation of Selenium RC is more complex. The downloaded ZIP-File contains client drivers for several programming languages (.Net, java, perl, php, python and ruby) and the Selenium Server (a simple Java jar file, Java 1.5 needed). To start the server, extract and navigate to the "selenium-server-1.X.X" directory and type "java -jar selenium-server.jar". Now you can comminucate via one of the client drivers with the server running on port 4444.
SeleniumRC Server Startup

Handling & Usability: Star2Star2

Selenium RC does not provide any help to create test cases. Therefore you have to write them on your own, using one of the programming languages and the appropriate client drivers. Another further possibility is to capture tests using the Selenium IDE. Captured tests can be exported to scripts using every supported programming language. So you can create at least test case sceletons using the Selenium IDE. For example exporting a captured test case to Java creates a complete Unit test which is ready to execute.
Selenium RC only acts as the missing link between the programming language and the browser. Therefore you have to take care of the framework to run the tests on your own. In case of Java you could use Eclipse to create and run the Java Unit Tests. Regardless which programming language you have chosen, you have to integrate the client driver somehow. The client driver adds the Selenium interaction functionality (functions to interact with browser elements) as well as the functionality to communicate with the Selenium Server.
SeleniumRC JUnit Test
With Selenium RC you can choose the browser to tests. For example in this test "*firefox" tells Selenium RC to use Firefox (*iexplore is for using Internet Explorer, furthermore  with the *custom keyword you could use any browser you want specified by the location of its executable). When running the test, Selenium opens to browser windows, one with the application under test (in this case www.google.com) and one with a test overview. When the test is finished, the browser quits automatically and the result is shown as red or green depending on the status of the result.

Predefined Functionality:

Selenium RC offers the same functionality as Selenium IDE but with the ability to use the whole functionality of the current client programming language, so you can create mighty tests.

Data-Driven Testing:

Again Selenium RC on its own is not able to run dynamic tests. If used with the client programming language it is possible to implement Data-Driven Testing. Furthermore some self made wrappers for FitNesse are available.

Compatibility: 

Selenium RC runs on every platform supporting Java 1.5+. With its wide support for programming languages it fits into most existing environments. Also the great support for almost every JavaScript compatible browser is quite almost unique.

Conclusion - Selenium RC:

If tests need to run in different browsers, every night or every build, Selenium RC is the right product. The setup ofSelenium RC is more complex than the simple installation of the Firefox add-on Selenium IDE, but you get the capabilities to create more complex and dynamic tests. To use Selenium RC you have to be familiar with at least one of the programming languages of a supported client driver.

1 comment: