{"id":540,"date":"2023-11-24T13:14:32","date_gmt":"2023-11-24T13:14:32","guid":{"rendered":"https:\/\/www.kaashivinfotech.com\/blog\/?p=540"},"modified":"2025-07-19T10:43:21","modified_gmt":"2025-07-19T10:43:21","slug":"selenium-architecture","status":"publish","type":"post","link":"https:\/\/www.kaashivinfotech.com\/blog\/selenium-architecture\/","title":{"rendered":"Selenium Architecture"},"content":{"rendered":"<h2>Selenium Architecture<\/h2>\n<h2>Introduction<\/h2>\n<p>Selenium was developed in 2004 by Jason Huggins, a Thoughtworks engineer, to address the shortcomings of manual testing. He developed a solution in the form of a program using JavaScript. He initially named it JavaScript TestRunner. Later on, when he realized that the program could do much more, he renamed it Selenium Core and open-sourced it.<\/p>\n<p>Next Selenium Remote Control (RC) or better known as Selenium 1 was developed by Paul Hammant, another ThoughtWorks engineer. Selenium RC was developed to solve domain-related issues while testing web applications.<\/p>\n<p>This further escalated to the development of Selenium Grid for parallel testing purposes. Next, Selenium IDE was developed to automate the browser through the record and playback features (similar to UFT\/QTP). In 2008, the Selenium team decided to merge the web driver and Selenium RC into a tool called Selenium 2, which later evolved to Selenium 3 or better known as Selenium WebDriver. Selenium RC is now deprecated and moved to legacy packaging.<\/p>\n<h2>\u00a0<strong>What is Selenium?<\/strong><\/h2>\n<p><a href=\"https:\/\/www.kaashivinfotech.com\/blog\/top-selenium-frameworks\/\">Selenium<\/a> is an open-source framework used to automate the testing of web applications. If you are looking forward to automating functional and regression test cases, then\u00a0 would be the right choice! Test scripts can be written in using different programming languages like Java, Python, C#, Ruby, and JavaScript.<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\" wp-image-541 aligncenter\" src=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2023\/10\/selenium.png\" alt=\"\" width=\"273\" height=\"284\" \/><\/p>\n<h2><strong>What is Selenium WebDriver?<\/strong><\/h2>\n<p><a href=\"https:\/\/www.selenium.dev\/\" target=\"_blank\" rel=\"noopener\">Selenium<\/a> WebDriver is currently the most widely used component in the Selenium tool suite. Selenium WebDriver: Selenium 2 integrated with WebDriver API provides an understandable programming interface. JAVA and C# languages are mostly preferred to work with Selenium.<\/p>\n<h2>\u00a0<strong>Architecture<\/strong><\/h2>\n<p>Selenium WebDriver is currently the most widely used component in the Selenium tool suite. Selenium WebDriver: Selenium 2 integrated with WebDriver API provides an understandable programming interface. JAVA and C# languages are mostly preferred to work with Selenium.<\/p>\n<p>Before diving into Selenium WebDriver architecture, let us look at its components.<\/p>\n<p>Selenium 3\u2019s architecture consists of five layers.<\/p>\n<p><img decoding=\"async\" class=\" wp-image-1230 aligncenter\" src=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2023\/11\/27-11-23-2.png\" alt=\"\" width=\"702\" height=\"517\" srcset=\"https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2023\/11\/27-11-23-2.png 626w, https:\/\/www.kaashivinfotech.com\/blog\/wp-content\/uploads\/2023\/11\/27-11-23-2-300x221.png 300w\" sizes=\"(max-width: 702px) 100vw, 702px\" \/><\/p>\n<h3><strong>1.Selenium Client Library<\/strong><\/h3>\n<p>Selenium Client Library or language bindings is a programming library that consists of commands in the form of an external jar file that are compatible with Selenium protocol\/W3C Selenium protocol. The selenium client library can be divided into two groups:<\/p>\n<h4><strong>Web Driver protocol clients<\/strong><\/h4>\n<p>They are thin wrappers around WebDriver protocol HTTP calls. Based on the user\u2019s preferred programming language, the library can be downloaded from Selenium\u2019s official repository. The library can later be added while creating a new project or a new Maven project in Eclipse or IntelliJ.<\/p>\n<h4><strong>WebDriver-based tools <\/strong><\/h4>\n<p>These are higher-level libraries that allow us to work with WebDriver automation. Testing frameworks like Selenide, webdriver.io, or AI-powered Selenium extensions like Healenium come under this group. These tools rely on lower-level webdriver protocols to function efficiently.<\/p>\n<h3><strong>2.Selenium API<\/strong><\/h3>\n<p>Selenium API is a set of rules and regulations that the programs use to communicate with each other. APIs work as an interface between the program and aid in their interaction without any user knowledge.<\/p>\n<h3><strong>3.JSON Wire protocol<\/strong><\/h3>\n<p>JSON is used in web services in REST and is a widely accepted method for communication between heterogeneous systems. The Selenium WebDriver uses JSON to communicate between client libraries and drivers. The JSON requests sent by the client are converted into HTTP requests for the server\u2019s understanding and again converted back to JSON format while sending it to the client again. This data transfer process is serialization. By this method, the internal logic of the browser is not revealed, and the server can communicate with the client libraries, even if it is not aware of any programming language.<\/p>\n<h3><strong>4.Browser Drivers<\/strong><\/h3>\n<p>Browser drivers act as a bridge between the Selenium libraries and the browsers. They help to run Selenium commands on the browser. Each of the browsers has separate drivers, which can be downloaded from Selenium\u2019s official repository. While using a browser driver, we need to import the respective Selenium package \u201corg.openqa.selenium.[$browsername$];\u201d in our code. We should also set the System property of the executable file of the browser driver using the following syntax:<\/p>\n<p>System.setProperty(key, value)<\/p>\n<p>Where the key is the driver\u2019s name and value is the path to the executable file of the driver in the user\u2019s device.<\/p>\n<h3><strong>5.Browser<\/strong><\/h3>\n<p>All the browsers supported by Selenium come under this category. Selenium test scripts can be run across various browsers like Chrome, Safari, Firefox, Opera, and Internet Explorer and operating systems like Windows, Mac OS, Linux, and Solaris.<\/p>\n<h4><strong>Quick notes<\/strong><\/h4>\n<ul>\n<li>Selenium architecture comprises 5 components; Selenium Client Library, Selenium API, JSON Wire Protocol, Browser Drivers, and Browsers.<\/li>\n<li>Selenium Client library \u2013 Selenium commands in the desired programming language in compliance with the W3C Selenium protocol.<\/li>\n<li>Selenium API \u2013 Facilitates software-to-software interaction.<\/li>\n<li>JSON Wire Protocol \u2013 Communication method between client libraries and drivers.<\/li>\n<li>Browser drivers \u2013 Support interaction between Selenium library and web browser.<\/li>\n<\/ul>\n<h2><strong>Working\u00a0<\/strong><\/h2>\n<p>Imagine the working of Selenium WebDriver like a conversation between you, a foreign tourist, and your friend. The tourist is asking for directions, but you are new in the city. You know the tourist\u2019s language, but your friend knows the directions in and out. So, you ask the tourist what they want in their language, and translate it for your friend. Your friend tells you the directions in a jiffy, and you quickly explain it to the tourist in their language. Sounds simple right? Now let us relate this scenario with the components in our Selenium Architecture!<\/p>\n<p>Here\u2019s an example script for login written in Selenium JAVA (Element values used are for illustration purposes)<\/p>\n<div class=\"code-embed-wrapper\"> <pre class=\"language-java code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-java code-embed-code\">Package InterviewBitBlog;<br\/><br\/>import.org.openqa.selenium.chrome.ChromeDriver;<br\/><br\/>import org.openqa.selenium.By;<br\/><br\/>import org.openqa.selenium.WebDriver;<br\/><br\/>import org.openqa.selenium.WebElement;<br\/><br\/>import org.testng.Assert;<br\/><br\/>Public class IBContent{<br\/><br\/>@BeforeTest<br\/><br\/>Public void login(){<br\/><br\/>System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;C:\\\\downloads\\\\chromedriver.exe&quot;)<br\/><br\/>ChromeDriver driver=new ChromeDriver<br\/><br\/>@Test<br\/><br\/>public void loginAutomationTest() {<br\/><br\/>driver.get(&quot;www.samplelogin.com&quot;);<br\/><br\/>Assert.assertEquals(driver.getTitle(),&quot;Home&quot;);<br\/><br\/>WebElement signInLink = driver.findElement(By.linkText(&quot;signin&quot;));<br\/><br\/>signInLink.click();<br\/><br\/>WebElement user = driver.findElement(By.id(&quot;username&quot;));<br\/><br\/>user.sendKeys(&quot;test&quot;);<br\/><br\/>WebElement pass = driver.findElement(By.id(&quot;password&quot;));<br\/><br\/>pass.sendKeys(&quot;test&quot;);<br\/><br\/>WebElement log = driver.findElement(By.name(&quot;Login&quot;));<br\/><br\/>log.click();<br\/><br\/>}<\/code><\/pre> <div class=\"code-embed-infos\"> <\/div> <\/div>\n<h2><strong>Advantages<\/strong><\/h2>\n<ul>\n<li>It is open-source, supports many languages, and is compatible with many operating systems.<\/li>\n<li>Selenium WebDriver architecture is designed to support cross-browser testing and parallel testing.<\/li>\n<li>Selenium WebDriver supports integration with various frameworks like Maven, and ANT for code compilation.<\/li>\n<li>It also supports integration with testing frameworks like TestNG to improve automation testing and reporting.<\/li>\n<li>Selenium can be integrated with Jenkins for CI\/CD purposes.<\/li>\n<li>Selenium has strong community support which makes troubleshooting pretty easy.<\/li>\n<\/ul>\n<h2><strong>\u00a0Disadvantages<\/strong><\/h2>\n<ul>\n<li>It does not support testing of Windows applications as it works only on web applications.<\/li>\n<li>It depends on third-party frameworks like TestNG and Cucumber for reporting, as it does not have inbuilt reporting features.<\/li>\n<li>This\u00a0 architecture is not prepared to handle dynamic web elements accurately, thus affecting test results.<\/li>\n<li>It\u00a0 does not handle frames and pop-ups efficiently.<\/li>\n<li>It\u00a0 does not automate captcha, barcodes, and test cases that involve fingerprints.<\/li>\n<\/ul>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>I hope this article gave you a fair idea of Selenium Architecture. If you are preparing for interviews based on Selenium, then check out our Selenium Interview questions compilation. Visit InterviewBit for more resources and training programs to help you crack those tough interviews in your dream companies!<\/p>\n<h2><strong>FAQs <\/strong><\/h2>\n<h3><strong>1.What is Selenium architecture?<\/strong><\/h3>\n<p>Selenium architecture refers to the structure and components of the Selenium automation testing framework. It includes various layers and components that work together to automate web testing.<\/p>\n<h3><strong>2.What are the key components of Selenium architecture?<\/strong><\/h3>\n<p>The key components of Selenium architecture include Selenium Client Library, Selenium API, JSON Wire Protocol, Browser Drivers, and Browsers.<\/p>\n<h3><strong>3.What is the role of Selenium Client Library?<\/strong><\/h3>\n<p>Selenium Client Library provides commands in the form of external jar files that are compatible with the Selenium protocol. It allows users to write test scripts in their preferred programming languages.<\/p>\n<h3><strong>4.What is the significance of JSON Wire Protocol in Selenium?<\/strong><\/h3>\n<p>JSON Wire Protocol is used for communication between client libraries and drivers. It converts client requests into HTTP requests for the server&#8217;s understanding and ensures seamless interaction between components.<\/p>\n<h3><strong>5.What are Browser Drivers in Selenium architecture?<\/strong><\/h3>\n<p>Browser Drivers act as bridges between Selenium libraries and web browsers. They facilitate the execution of Selenium commands on browsers. Each browser has its own specific driver.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Selenium Architecture Introduction Selenium was developed in 2004 by Jason Huggins, a Thoughtworks engineer, to address the shortcomings of manual testing. He developed a solution in the form of a program using JavaScript. He initially named it JavaScript TestRunner. Later on, when he realized that the program could do much more, he renamed it Selenium [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1194,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[219],"tags":[405,407,406,1022,1014,1015,1028,1027,1017,1019,1016,1026,1025,1021,1020,408,403,1018,409,1029,1023,1024,1030,402,401,404],"class_list":["post-540","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-architecture","tag-advantages-of-selenium-webdriver-architecture","tag-architecture-of-selenium-webdriver-architecture","tag-disadvantages-of-selenium-webdriver","tag-selenium","tag-selenium-architecture","tag-selenium-architecture-explanation","tag-selenium-edureka","tag-selenium-framework","tag-selenium-framework-architecture","tag-selenium-grid-architecture","tag-selenium-rc-architecture","tag-selenium-suite","tag-selenium-training","tag-selenium-tutorial","tag-selenium-webdriver","tag-selenium-webdriver-advantages","tag-selenium-webdriver-architecture","tag-selenium-webdriver-architecture-explanation","tag-selenium-webdriver-disadvantages","tag-selenium-webdriver-example","tag-selenium-webdriver-tutorial","tag-webdriver-architecture","tag-webdriver-architecture-in-selenium","tag-what-is-selenium-webdriver","tag-what-is-selenium","tag-working-of-selenium-webdriver"],"_links":{"self":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/comments?post=540"}],"version-history":[{"count":0,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/540\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media\/1194"}],"wp:attachment":[{"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/media?parent=540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/categories?post=540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kaashivinfotech.com\/blog\/wp-json\/wp\/v2\/tags?post=540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}