Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.
Selenium RC Including support for several languages (Java, Javascript, PRuby, HP, Python, Perl and C#) and support for almost every browser.
Selenium RC components:
The Selenium Server, which launches and kills browsers.
Client libraries which provide the interface between each programming language and the Selenium RC Server.
Related Page: Sample Programs In Remote Control For Selenium
Client libraries communicate with the Server passing each Selenium command for execution. Then the server passes the Selenium command to the browser using Selenium-Core JavaScript commands. The browser, using its JavaScript interpreter, executes the Selenium command. This runs the Selenese action or verification you specified in your test script.
• Install the Selenium RC Server.
• Set up a programming project using a language specific client driver
Checkout Selenium Interview Questions
The Selenium RC server is simply a Java jar file (selenium-server.jar), which doesn’t require any special installation. Just downloading the zip file and extracting the server in the desired directory is sufficient.
• Go to https://seleniumhq.org/download/.
• Under Selenium Server (formerly the Selenium RC Server) section, you can see the selenium server latest version.
• Click on download, it will be redirected to selenium server download page.
• Selenium server is a JAR file. Download selenium serverstandalone-2.ob3.jar
Create a Folder selenium in “C” drive.
Paste the selenium-server-standalone-2.ob3.jar file in that folder.
We need to be able to start and stop the Selenium Server.
We can do this at the command line:
Start: (Command line)
java -jar selenium-server-standalone-2.0b3.jar
The output should appear similar to the following screenshot.
Stop: (Browser)
https://localhost:4444/seleniumserver/ driver/?cmd=shutDownSeleniumServer
Selenium IDE scripts may be run in Selenium RC by running them directly on the server with a -htmlSuite parameter.
Imagine that you have to run your Selenium IDE tests on a computer that doesn’t have Selenium IDE installed or you do not want to use Firefox with any add-ons installed. To do this, you will need to use Selenium Remote Control.
1. Record your test case using Selenium IDE
2. Play your test case using selenium IDE, it to make sure that your test case works.
3. Export your recording test case – as html file.
4. Create a test suite.
5. Run your exported html test case using selenium RC
Execute Selenium RC via command line against Firefox, Chrome and Internet explorer.
Create folders:
Create a folder in any drive – Ex: C:tests
Create a folder in any drive – Ex: C:results
We need to create two folders.
1. To save our test suite and test case. (tests)
2. To save results (results)
Using Selenium IDE record a test case and save it as .html in a tests folder. Make sure your test run correctly.
Related Page: How to Create test suites in Selenium
Create a Test suite:
RC operates on SIDE test suite files, rather than test case files. The test suite contains the file names of the test case(s) to run. A test suite file exists in the same directory as the test case file(s).
Create a test suite and save it in C:tests folder
To run our tests in Selenium Remote Control, we will have to use the –html suite argument. This tells Selenium to open the Test Suite that we created. We then need to tell it where to find the Test Suite and then where to write the results to. Our command in Command Prompt or a console window will be similar to the following snippet:
We can run our tests in any browser by using selenium RC.
Synatx:
java -jar selenium-server.jar -htmlSuite “*browser”
“https://www.example.com” “target folder” “results folder“
RUN THE ABOVE COMMAND FROM COMMAND PROMPT
Run this command from selenium directory.
Example:
C:s0elenium>java -jar selenium-server.jar -htmlSuite “*iexplore”
“https://www.google.com” “c:testsrun.html“ “c:resultsresults1.html”
Below is the screenshot of TEST RUNNER
Free Demo for Corporate & Online Trainings.