{"id":16062,"date":"2024-05-08T10:50:10","date_gmt":"2024-05-08T05:20:10","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=16062"},"modified":"2025-10-13T06:20:25","modified_gmt":"2025-10-13T10:20:25","slug":"selenium-rc","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/selenium-rc\/","title":{"rendered":"Selenium RC Legacy Test Automation Explained for Beginners"},"content":{"rendered":"\n<p>Selenium RC is a main selenium project which is sustained for a longer period of time before the selenium WebDriver which came into existence. The Selenium RC will be in use as webDriver provides strong features and continue to develop the scripting using the RC. It provides to code the command for automated web application UI tests supports full power of programming languages like java, C#, perl and python create more complex tests read write operations on files, querying a database and emailing test results.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Selenium RC Architecture<\/strong><\/h2>\n\n\n\n<p><strong><\/strong>Selenium RC will work in such a way that the client libraries will communicate with all the selenium RC Server that is passing with each Selenium command to the browser using Selenium core is JavaScript commands.<\/p>\n\n\n\n<p>The browser will run the selenium commands using its JavaScript interpreter<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/ZOU0AuRnQsBY2jpb6MQpJm51wJxqbiUjT3dQRGp901EbSqeFUQ6x9tUjRhjnta3GYTf5oyO2wKmHzo0Y7LT2HQu0wMjujUGIjtHDF9B2PBgVzTDkMJoip5xCbKq4ihzHEjOM2FXadIKoNqy5Pq8GVw\" alt=\"Selenium IDE 52\" title=\"\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Selenium RC will come into the parts:<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Selenium Server will launch and kills browsers. It interprets and executes the selenese commands. There are properties of HTTP proxy by intercepting and validating HTTP messages forwarded between the browser and application which is under test.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>There are client libraries has interface between one programming languages and the\u00a0 other as Selenium RC server.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>RC scripting:<\/strong><\/h2>\n\n\n\n<p><strong><\/strong>Consider a sample script using Selenium Remote Control. When we use <a href=\"http:\/\/www.calculator.net\/\" rel=\"nofollow noopener\" target=\"_blank\">http:\/\/www.calculator.net\/<\/a> for knowing Selenium RC. We can calculate using \u2018Percent calculator\u2019 the present under the \u2018Math Calculators\u2019 module.<\/p>\n\n\n\n<p>Step 1: Start selenium Remote control.<\/p>\n\n\n\n<p>Step 2: When launching Selenium RC, we have to open Eclipse and create a \u201cNew Project\u201d as&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/8qhr7uEiSY1C3tE3LlFsBBWAY9avcOt8G2q6F6FmT4NN6MT_4x6UWCcPMmrKN_JJZFD4eODVbh9amnXnRvoTWEJwXZKXoNWc-b4RqP3XnSZGt-_k-5cU8aqYycAHHnPx-5MwuKwng9pN7PrHtF9jjQ\" alt=\"Selenium IDE 53\" title=\"\"><\/figure>\n\n\n\n<p>Step 3: We have to enter the project name and click \u201cNext\u201d button.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/RbU1MYrducSWn9jHk6oq8UblpUsVXgjSNI_oxqW9fSW9k0rQzvKaWSvK1Lk0XdMngzhg2PPheE6H5nXbbWzvuUDqqbQYrNGg6-I0oecV3GPDF_kGQKeamH_CN39VSmJutmqxIsE3p8uWim6VXewQxQ\" alt=\"Selenium IDE 54\" title=\"\"><\/figure>\n\n\n\n<p>Step 4: Verify the source project,libraries and output folder and click \u201cfinish\u201d.<\/p>\n\n\n\n<p>Step 5: By right clicking on the project we choose to \u201cConfigure build path\u201d<\/p>\n\n\n\n<p>Step 6: Properties for \u2018selrcdemo\u2019can be used up. These transfer to \u2018Libraries\u2019 tab and click \u2018Add external JARs. Select the selenium RC jar file we have downloaded and it would appear.<\/p>\n\n\n\n<p>Step 7: The referenced Libraries which are shown&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/VZ5LsiF3Zhsz42lTTCaumdv4ozaRAl7k-eQ66faSh5shi1X624oW3iiYoKqaOmPiV0Wd-xUc9ZFhnQOGbWHPyQRWhLjH9jz1AFeiPIl6DhE66G3zv63iPng7OxAhhKDwRgv7SiXusahr6gK9-ZE9QA\" alt=\"Selenium IDE 58\" title=\"\"><\/figure>\n\n\n\n<p>Step 8: It is used to create new class file by performing a \u2018right click\u2019 on \u2018src\u2019 folder and select \u2018New\u2019&gt;&gt;\u2019class\u2019.<\/p>\n\n\n\n<p>Step 9: We enter the name of the class file and also enable \u2018public static void main\u2019.<\/p>\n\n\n\n<p>Step 10: It has Class is created under the folder structure.<\/p>\n\n\n\n<p>Step 11: Now it is time for coding. The following code has comments that are embedded in it to make the readers understand has been put forth.<\/p>\n\n\n\n<p>Package selrcdemo;<\/p>\n\n\n\n<p>Import com.thoughtworks.selenium.DefaultSelenium;<\/p>\n\n\n\n<p>Import com.thoughtworks.selenium.Selenium;<\/p>\n\n\n\n<p>public class rcdemo {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;public static void main(String[] args) throws InterruptedException \/\/ This is Main function<\/p>\n\n\n\n<p>{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Selenium selenium1 = new DefaultSelenium(&#8220;localhost&#8221;, 4444 , &#8220;Mozilla Firefox&#8221;, &#8220;http:\/\/www.Calculator.net&#8221;);&nbsp; &nbsp; &nbsp; \/\/ Instatiate the RC Server<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.start(); &nbsp; \/\/ Start<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.open(&#8220;\/&#8221;);&nbsp; \/\/ Open the URL<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.windowMaximize();<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Click on Link Math Calculator<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.click(&#8220;xpath = .\/\/*[@id = &#8216;menu&#8217;]\/div[3]\/a&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread.sleep(2500); \/\/ Wait for page load<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Click on Link Percent Calculator<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.click(&#8220;xpath = .\/\/*[@id = &#8216;menu&#8217;]\/div[4]\/div[3]\/a&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thread.sleep(4000); \/\/ Wait for page load<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Focus on text Box<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.focus(&#8220;name = cpar1&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ enter input in Text box 1<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.type(&#8220;css=input[name = \\&#8221;cpar1\\&#8221;]&#8221;, &#8220;10&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ enter a input Text box 2<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.focus(&#8220;name = cpar2&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.type(&#8220;css = input[name = \\&#8221;cpar2\\&#8221;]&#8221;, &#8220;50&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/ Click Calculate button<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;selenium1.click(&#8220;xpath = .\/\/*[@id = &#8216;content&#8217;]\/table\/tbody\/tr\/td[2]\/input&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp; By verify if the result is 5<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String result = selenium1.getText(&#8220;.\/\/*[@id = &#8216;content&#8217;]\/p[2]&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (result == &#8220;5&#8221;) {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&#8220;Pass&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println(&#8220;Fail&#8221;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>Step 12&nbsp;\u2013 We will&nbsp; execute the script by clicking &#8216;Run&#8217; Button.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/puJ6t-tFzm4C6T5qMxJOxnDPVa7LtQbiUDCWL-hYYhL52q9I6px9GiQs7j2V_5ysJwbOxHORVL5jMeiqSF0FWbQvNkrx6aUEuJeynx_rIKqbc3n64ug6l38MDZdJhTXzUcvl3VNJ8lbtXTvZssHTyQ\" alt=\"Selenium IDE 72\" title=\"\"><\/figure>\n\n\n\n<p>Step 13: Here the script will be starting to run and the user will be able to see that the command history under the \u2018Command History\u2019 Tab.<\/p>\n\n\n\n<p>Step 14: The final state of the application is shown. The percentage will be calculated and it is displayed the result&nbsp; on screen.<\/p>\n\n\n\n<p>Step 15: The output is tested will be printed on the Eclipse console as shown below as we&nbsp; have printed output&nbsp; to console.In real&nbsp; time the output to an HTML file or a simple Text file.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-us.googleusercontent.com\/ub6ep4yi51lsVCxxeW0_Fq7Z_cQ-rGznQsGMEfl3nkjIPQdpWUUHf3uFyLgW6HLCo_7JOVkm7SGC-V5TgeInnDAr4MvwyQgMKGSu56tXsexdkMPRUQQCIIVDpOzjATIO2DT8NekwGwDmzQ8coqWV8g\" alt=\"Selenium IDE 74\" title=\"\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Questions<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Explain Selenium RC?<\/li>\n\n\n\n<li>Explain the Architecture and advantages of Selenium RC?<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Selenium RC is a main selenium project which is sustained for a longer period of time before the selenium WebDriver which came into existence. The Selenium RC will be in use as webDriver provides strong features and continue to develop the scripting using the RC. It provides to code the command for automated web application [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":16063,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-16062","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-selenium-tutorials"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/16062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=16062"}],"version-history":[{"count":1,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/16062\/revisions"}],"predecessor-version":[{"id":30630,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/16062\/revisions\/30630"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/16063"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=16062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=16062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=16062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}