<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Shanthi Priya on Medium]]></title>
        <description><![CDATA[Stories by Shanthi Priya on Medium]]></description>
        <link>https://medium.com/@vshanthipriya?source=rss-81d6f79878a2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wdfK_mg3wGEN4y7U_RGIkw.jpeg</url>
            <title>Stories by Shanthi Priya on Medium</title>
            <link>https://medium.com/@vshanthipriya?source=rss-81d6f79878a2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 22:19:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vshanthipriya/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Synchronization In Selenium WebDriver]]></title>
            <link>https://medium.com/@vshanthipriya/synchronization-in-selenium-webdriver-3cfc4333ea55?source=rss-81d6f79878a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/3cfc4333ea55</guid>
            <dc:creator><![CDATA[Shanthi Priya]]></dc:creator>
            <pubDate>Tue, 16 May 2023 18:04:44 GMT</pubDate>
            <atom:updated>2023-05-16T18:04:44.919Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*d8qJnqruXzPj-lOF.png" /></figure><p><strong>Introduction</strong></p><p>While executing a test case or test cases sometimes test execution speed may not match with your application process speed. Because of this test execution will get failed. To avoid this we have to determine this time gap and manage this time gap which is called as Synchronization.</p><p>When two or more components work together to perform any action at the same pace, the process is called synchronization. In Selenium, there should be synchronization between selenium script, web app and the script execution speed. When you tend to locate an element in your script which is yet to load on the page, selenium will throw you ‘<strong>ElementNotVisibleException</strong>’ message.</p><h3>Types of Selenium Waits</h3><ul><li>Implicit Wait</li><li>Explicit Wait</li><li>Thread.Sleep() method</li><li>Fluent Wait</li></ul><p>Let us understand each one of these in-depth.</p><p><strong>Implicit Wait </strong>:</p><p>1. It directs the selenium webdriver to wait for a certain measure of time before throwing an exception.</p><p>2. It is declared globally, which means it is always available for all the web elements throughout the driver instance.</p><p>3. The key point to note here is, unlike Thread.Sleep(), it does not wait for the complete duration of time.</p><p>4. In case it finds the element before the duration specified, it moves on to the next line of code execution, thereby reducing the time of script execution. This is why Implicit wait is also referred to as dynamic wait.</p><p>5. If it does not find the element in the specified duration, it throws <strong>ElementNotVisibleException</strong>.</p><p>Old Syntax : Before Selenium 4 . This one is deprecated.</p><pre>driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);</pre><p>Syntax : After Selenium 4 this is the syntax used.</p><pre>driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));</pre><p><strong>Advantages Of Implicit Wait </strong>:</p><ol><li>Since it is declared globally code looks readable and optimized.</li></ol><p><strong>Disadvantage Of Implicit Wait:</strong></p><ol><li>Implicit wait will hide the performance issues of the application.</li></ol><p><strong>Practical Example Of Implicit Wait</strong></p><p>I have used <a href="https://www.makemytrip.com/">https://www.makemytrip.com/</a> for demo . You can try with any websites.</p><pre>public class Demo1 {<br><br> public static void main(String[] args) throws Interrupted Exception {<br><br>  WebDriver driver =new EdgeDriver();<br><br>  driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));//Implicit wait declared globally.<br><br>  driver.manage().window().maximize();<br><br>  driver.get(&quot;https://www.makemytrip.com/&quot;);<br><br>  driver.findElement(By.xpath(&quot;//ul[@class=&#39;fswTabs latoBlack greyText&#39;] //li[@data-cy=&#39;roundTrip&#39;]&quot;)).click();<br><br>  driver.findElement(By.cssSelector(&quot;input#fromCity&quot;)).click();<br><br>  //Thread.sleep(3000);// Tried this. Not a good practice to use this wait.<br><br>  driver.findElement(By.xpath(&quot;//input[@aria-autocomplete=&#39;list&#39;]&quot;)).sendKeys(&quot;chennai&quot;);<br><br><br>  driver.findElement(By.xpath(&quot;//div[@class=&#39;makeFlex hrtlCenter&#39;] [contains(.,&#39;Chennai, India&#39;)]&quot;)).click();<br><br>  driver.findElement(By.cssSelector(&quot;a[class*=&#39;primaryBtn&#39;]&quot;)).click();</pre><p><strong>Explicit Wait :</strong></p><p>1. The Explicit wait is another one of the dynamic Selenium waits. It is classified into A. WebDriver wait and B. Fluent wait.</p><p>2.The Explicit Wait in Selenium is used to tell the Web Driver to wait for certain conditions (Expected Conditions) or maximum time exceeded before throwing “ElementNotVisibleException” exception.</p><p>3. It is an intelligent kind of wait, but it can be applied only for specified elements. In a scenario where you do not know the amount of time to wait for, this explicit wait comes in handy.</p><p><strong>Types of Expected Conditions:</strong></p><p>Below are the few types of expected conditions commonly used as you perform automation testing with Selenium.</p><ul><li><strong>visibilityOfElementLocated()-</strong> Verifies if the given element is present or not</li><li><strong>alertIsPresent()-</strong> Verifies if the alert is present or not.</li><li><strong>elementToBeClickable()-</strong> Verifies if the given element is present/clickable on the screen</li><li><strong>textToBePresentInElement()-</strong> Verifies the given element have the required text or not</li><li><strong>titles()-</strong> Verify the condition wait for a page that has a given title</li></ul><p>There are many more expected conditions available, which you can refer through the <a href="https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/ExpectedConditions.html">Selenium official page</a>.</p><p>Old Syntax : Before Selenium 4. This one is deprecated.</p><pre>WebDriverWait wait = new WebDriverWait(driver,10);  wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(&quot;.classlocator&quot;)));</pre><p>New Syntax: After Selenium 4 this is the syntax used.</p><pre>WebDriverWait wait = new WebDriverWait(driver,Duration.ofSeconds(10)); wait.until(ExpectedConditions.visibilityOfElementLocated(By.Xpath(&quot;.classlocator&quot;)));</pre><p>To use Explicit Wait in test scripts, import the following packages into the script.</p><pre>import org.openqa.selenium.support.ui.ExpectedConditions<br>import org.openqa.selenium.support.ui.WebDriverWait</pre><p>Then, Initialize A Wait Object using <em>WebDriverWait</em> Class. WebDriverWait is a class and to access all the methos available in it an object wait is created. It takes 2 arguments . One is driver and another one the time in secs. Basic Java knowledge will be helpful in understanding these syntaxes.</p><pre>WebDriverWait wait = new WebDriverWait(driver,30);</pre><p><strong>Advantages Of Explicit Wait</strong></p><ol><li>It is applied only wherever required. So no performance issues.</li></ol><p><strong>Disadvantage of Explicit Wait</strong></p><ol><li>More code.</li></ol><p><strong>Practical Example of Explicit Wait</strong></p><p>Don’t get confused with the code snippet shared below if you are a beginner. Just focus where Explicit wait is applied. By automating many demo websites will understand where Explicit wait is applied.</p><pre>public class demo2 {<br><br> public static void main(String[] args) throws InterruptedException {<br><br>  WebDriver driver =new EdgeDriver(); //did not download the drivers. Added the dependency selenium manager version 4.6.0. in pom.xml file. It was in beta phase while I was writing this blog.<br><br>  WebDriverWait w=new WebDriverWait(driver,Duration.ofSeconds(30));<br><br>  driver.manage().window().maximize();<br><br>  JavascriptExecutor js=(JavascriptExecutor)driver;<br><br>  driver.get(&quot;https://juice-shop.herokuapp.com/#/register&quot;);<br><br>  js.executeScript(&quot;window.scrollBy(0,1000)&quot;,&quot;&quot;);<br>  <br>  driver.findElement(By.xpath(&quot;//button[@aria-label=&#39;Close Welcome Banner&#39;]&quot;)).click();<br><br>  driver.findElement(By.id(&quot;emailControl&quot;)).sendKeys(&quot;xyz@gmail.com&quot;);<br><br>  driver.findElement(By.xpath(&quot;//input[@type=&#39;password&#39;]&quot;)).sendKeys(&quot;pwd&quot;);<br><br>  driver.findElement(By.cssSelector(&quot;input#repeatPasswordControl&quot;)).sendKeys(&quot;pwd&quot;);<br><br>  driver.findElement(By.className(&quot;mat-slide-toggle-thumb&quot;)).click();<br><br>  //Thread.sleep(2000);<br>  w.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(&quot;//mat-select[@role=&#39;combobox&quot;)));//Explicit wait applied for a particular element which is causing issues.<br><br> Select dropdown=new Select(driver.findElement(By.xpath(&quot;//mat-select[@role=&#39;combobox&#39;]&quot;)));<br><br> dropdown.selectByIndex(6);<br><br> driver.findElement(By.xpath(&quot;//input[@id=securityAnswerControl&quot;)).sendKeys(&quot;tuffie&quot;);<br><br> driver.findElement(By.id(&quot;registerButton&quot;)).click();</pre><p><strong>Thread.Sleep() :</strong></p><p>1.It does not listen to the dome</p><p>2. Even if the application gets opened it waits till the time specified . Hence time is wasted.</p><p>3. Not preferred in real time frameworks.</p><p>Syntax</p><pre>Thread.sleep(3000)</pre><p><strong>Fluent Wait :</strong></p><p>1.It finds the web element repeatedly at regular intervals of time will the object gets found.</p><p>2.Fluent wait and WebDriver wait both are classes that implement wait interface.</p><p>3.While using Fluent Wait, it is possible to set a default polling period as needed. The user can configure the wait to ignore any exceptions during the polling period.</p><p>4.Fluent waits are also sometimes called smart waits because they don’t wait out the entire duration defined in the code.</p><p>5.Very rarely Fluent waits are used in real time.</p><p>Old Syntax : Before Selenium 4. This one is deprecated.</p><pre>Wait&lt;WebDriver&gt; wait = new FluentWait&lt;WebDriver&gt;(driver)   .withTimeout(30, TimeUnit.SECONDS).pollingEvery(5, TimeUnit.SECONDS)   .ignoring(NoSuchElementException.class);</pre><p>New Syntax : After Selenium 4 this is the syntax</p><pre>Wait&lt;WebDriver&gt; fluentWait = new FluentWait&lt;WebDriver&gt;(driver)         .withTimeout(Duration.ofSeconds(30))         .pollingEvery(Duration.ofSeconds(5))         .ignoring(NoSuchElementException.class);</pre><p><strong>Differences between Implicit And Explicit Wait</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/0*hgk8Q5qabun9tdxw.png" /></figure><p><strong>Conclusion</strong></p><p>In this blog we saw what is Synchronization concept in Selenium and what are the different types of waits available in selenium. In general it is recommended to use Explicit wait in our frameworks. Cypress has inbuilt wait mechanism. This is one of the major difference between Selenium and Cypress. It is said that if you want to drastically stabilize your test automation don’t use the combination of both implicit and explicit waits in Selenium. Hope you find this blog helpful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3cfc4333ea55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction To Cypress Testing Framework]]></title>
            <link>https://medium.com/@vshanthipriya/introduction-to-cypress-testing-framework-220ba09f4402?source=rss-81d6f79878a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/220ba09f4402</guid>
            <dc:creator><![CDATA[Shanthi Priya]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 22:13:30 GMT</pubDate>
            <atom:updated>2023-03-13T22:13:30.608Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/976/0*cO0UsLHCvNxmgJxL.png" /></figure><p><strong>Table of Contents</strong></p><p><strong>1.Introduction</strong></p><p><strong>2. Key Differences between Selenium and Cypress</strong></p><p><strong>3.Architecture of Cypress</strong></p><p><strong>4.Cypress Browser Support</strong></p><p><strong>5.Installation and Set Up</strong></p><p><strong>6.How to write and Execute Basic Test Cases in Cypress</strong></p><p><strong>7.Limitations in Cypress</strong></p><p><strong>8.Conclusion</strong></p><p><strong>Introduction</strong></p><p>Selenium is one of the hottest automation frameworks in the market. But in recent days more no of testers talk about this cypress. Even the projects which I worked used Selenium. Was curious to know about Cypress. So thought of writing this blog based on my understanding and few research. Cypress is more compared with Selenium. In this blog have discussed in detail what Cypress is all about and its uses.</p><p>Cypress is a front-end testing tool for web applications. As per the cypress documentation found in their official website Cypress is a next generation front end testing tool built for the modern web. Now a days many of the modern web applications are developed using latest Java Script frameworks such as Angular JS, React JS. To test such modern web applications such features which are available in Cypress.</p><p>Every automation tool uses a language to automate the tests. Cypress uses Java Script. It does not use any Selenium libraries. Cypress is different from Selenium which has been discussed in this blog. It is an open-source tool like Selenium. There are multiple components in Cypress. One such component is Cypress runner and dashboard. 80 % of the work like writing test cases, designing the framework and execution are done by Cypress runner. Dashboard is a paid one.</p><p>Cypress is built on Node JS environment, and it comes with NPM module. NPM is nothing but the node package manager was Cypress gets the needed libraries to work in our project. For ex while working in Java maven projects we have a global maven repository which has all the dependencies. We add the needed dependencies in the POM.XML</p><p>Before jumping into the installation part let us understand the key differences between Selenium and Cypress and the architecture of Cypress.</p><p><strong>Key Differences between Selenium and Cypress</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/0*Cr97QWHToLOTzWr4.png" /></figure><p><strong>Architecture of Cypress</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/0*3tCE-WX2PZOaNKpX.jpg" /></figure><ol><li>Cypress architecture is completely different from Selenium architecture. Do refer the following link for Selenium architecture <a href="https://www.numpyninja.com/post/selenium-webdriver-architecture">“https://www.numpyninja.com/post/selenium-webdriver-architecture&quot;.</a></li><li>Most testing tools like Selenium operate by running outside the browsers and executing remote commands across the network. But Cypress directly operates inside the browser. It is the browser that will be executing the code.</li><li>In selenium the requests will be sent to the browser driver which acts a middleman proxy. But in Cypress there is no middleman proxy.</li><li>This enables Cypress to listen and modify the browser behavior at run time by manipulating the DOM and altering network requests and responses which is really cool.</li><li>Due to the architecture design of Cypress, it is faster than Selenium.</li></ol><p><strong>Cypress Browser Support</strong></p><p>The version of Cypress when I was writing this blog was 12.7.0. Currently it supports Chrome and Electron browsers. Electron is one of the versions of Chrome. Electron is the light weighted browser of Chromium. Cypress has suggested to use Electron browser as it is light weight the tests will run much faster than any other browser. Firefox and IE are under construction.</p><p><strong>Installation and Setup</strong></p><p>1. Cypress is built on Node.js. First Node .js needs to be downloaded from <a href="https://nodejs.org/en/download/">“https://nodejs.org/en/download/</a>&quot;.</p><p>2. Create Base Cypress working folder in your system which will be responsible to store all our tests. Can give any name to that folder.</p><p>3. For Java we need JVM. Similarly, to write our Java Script we need to download Visual Studio Code editor from</p><p><a href="https://code.visualstudio.com/Download">“https://code.visualstudio.com/Download&quot;.</a></p><p>4. After installing the visual studio editor click File-&gt;New Window. Now we need to pull up the empty folder which we created in step 2 into this visual studio editor. Click File-&gt;Open Folder-&gt; select the empty project folder created.</p><p>5. Next download the Cypress dependencies for the empty project folder which we created. Need to generate package. Json file. This file is like the pom.xml file which we use in our maven projects.</p><p>6. Open the terminal in Visual Studio. On the left-hand corner, you can see I have moved the created empty project folder named Cypress Automation into Visual studio as mentioned in Step 4. Also below I have marked where the terminal can be found.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-zwDUCyZ7Xi_1rOQ.png" /></figure><p>7. Once we click this terminal option, we will get the path of our project. This also can be done through command prompt to get the path as it is developed by the same windows Microsoft team.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*codTrCAMLJQ2rLkS.png" /></figure><p>8. In the above screen shot in the terminal the green marker indicates the path where I created the empty project folder. After that path need to type the command <strong>npm init </strong>and hit enter. This npm. Init command is to auto generate package. Json for our project.</p><p>9. Once hitting the enter after entering the command it will ask for the name, version no, author name etc.</p><p>Can give any package name. Can skip the rest of the fields. Then after typing yes, we can see in the left side package. Json is created which is marked in red color.</p><p>10. The main hero Cypress should be introduced now. For downloading Cypress refer <a href="https://docs.cypress.io/">“https://docs.cypress.io/&quot;</a></p><p>We can declare the Cypress dependencies in package. Json file and use <strong>npm install</strong>. Another easy option is by using <strong>npm install cypress — -save -dev. </strong>Go with the second option. Cypress will get installed.</p><p>To run our test cases there are two different ways in Cypress. One ways is to run from command line and another way is to run from Test Runner. This Test Runner differentiates this Cypress from rest of the Automation tools. After we installed Cypress can see a file call node-module created and when expanded we can see the dependencies stored here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*33_qG3t-z7la6JGI.png" /></figure><p>We can type the following command <strong>node_modules\.bin\cypress open </strong>to open the cypress test runner that is<strong> the </strong>Cypress application. But got error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H_sDff-fKF5Vi-yV.png" /></figure><p>Hence can use another command <strong>npx cypress open </strong>and hit enter. A new window will get opened which provides the option E2E Testing and Component Testing. E2E Testing needs to be selected. After selecting E2E Testing Configuration files window gets opened like this screen shot shared below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B7RQ0_8lCWC-p6N7.png" /></figure><p>After clicking continue following window shared below will get opened to choose the browser. All the browsers installed in our system will get displayed. Electron by default is provided by Cypress.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zymA7VOb8kQUbefP.png" /></figure><p>Once start E2E Testing is clicked the following page will be opened which I have shown in the below screen shot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*p4584S-ioao0XTtq.png" /></figure><p>In your visual studio editor we can see the following folder structure would have been created automatically. Have shared the screen shot below. Under e2e we will be automation our test cases. In earlier versions e2e was named as integration folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/0*wh4LSCLz4YI8MtpN.png" /></figure><p><strong>How To Write and Execute Basic Test Cases In Cypress</strong></p><ol><li>File can be created in 2 ways. One is through Cypress application which will get reflected in the vs code editor. Right click on e2e and click new file. I have given the name as FirstTest.cy.js. The file name should have the extension cy.js.</li><li>This new created file will get reflected in Cypress application as well. In the terminal type the command <strong>npx cypress open </strong>to check.</li><li>By default, Cypress will follow mocha framework to write all our tests. This mocha framework automatically comes with Cypress. Need not download separately. In selenium we use TestNG testing framework to run our tests.</li><li>If we refer Cypress official documentation under end-to-end testing, we can check the syntax.</li><li>The syntax will be as follows:</li></ol><pre>describe(&quot;My First Test Suite&quot;, function()<br>{<br>it(&quot;My First Test case&quot;, function(){<br>//test steps<br>} }<br>it(&quot;My Second Test Suite&quot;, function()<br>{<br>//test steps<br>} }</pre><p>The describe takes 2 arguments. First one is description which can be any name suitable to the test. The second argument of description is a function that wraps all it blocks. Also instead of using function () it can be replaced with =&gt; function. So, the Java script can also be written with the following syntax:</p><pre>describe(&quot;My First Test Suite&quot;,()=&gt;<br>{<br>it(&quot;My First Test case&quot;,()=&gt;{<br>//test steps<br>} }<br>it(&quot;My Second Test Suite&quot;,()=&gt;<br>{<br>//test steps<br>} }</pre><p>Example:</p><pre>describe(&#39;My First Test Suite&#39;,()=&gt;<br>{<br>it(&#39;test1&#39;, ()=&gt;<br>{<br>cy. visit(&quot;https://www.hotels.com&quot;)<br>cy. title().should(&#39;eq&#39;,&#39;Title of the page&#39;) //Assertion<br>})<br>})</pre><p>Try the above sample testcase after installation part. Here cy is like a global command which will try to invoke any cypress command like driver in selenium. Need not create any object. Can start using it directly without any declaration. The above test case can be executed in following ways.</p><ol><li>We can execute the test case in Test runner that is we can launch our Cypress application by using the command<strong> npx cypress open</strong> in the terminal.</li><li>Another way is we can execute the test case directly in vs code editor terminal. The command <strong>npx cypress run</strong> by default runs in electron browser in headless mode. Can&#39;t see any UI.</li><li>For test cases to run in headed mode use the command <strong>npx cypress run — — headed</strong>.</li><li>We have seen one sample test case. There will be many numbers of test cases. To execute a specific spec file, use the command <strong>npx cypress run — — (specify the spec file path).</strong></li><li>To run in specific browser of our choice use the command<strong> npx cypress run — — browser chrome.</strong></li><li>To run in headed mode, use the command<strong> npx cypress run — — browser chrome — — headed.</strong></li></ol><p>Try executing few test cases by using the above commands mentioned for practice as a beginner in Cypress.</p><p><strong>Limitations In Cypress</strong></p><ol><li>Cypress support currently only Chrome and Firefox browsers.</li><li>Built in parallelization is not supported.</li><li>Multi tab or multi window interactions is not allowed in Cypress.</li><li>Cross browser testing is not possible</li><li>Only Java Script support for test case creation.</li><li>Limited support for mobile testing.</li></ol><p><strong>Conclusion</strong></p><p>Selenium and Cypress have many things in common but there are also some differences when we compare them. In this blog we saw what is Cypress all about and what are the key differences between Cypress and Selenium. Also we saw the installation part and how to write and execute the test case by using test runner and terminal with different commands.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=220ba09f4402" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interface And Its Role In Selenium]]></title>
            <link>https://medium.com/@vshanthipriya/interface-and-its-role-in-selenium-1d3406163502?source=rss-81d6f79878a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d3406163502</guid>
            <dc:creator><![CDATA[Shanthi Priya]]></dc:creator>
            <pubDate>Mon, 13 Mar 2023 06:07:53 GMT</pubDate>
            <atom:updated>2023-03-13T06:07:53.468Z</atom:updated>
            <content:encoded><![CDATA[<p>Overview</p><p>In this article as a beginner SDET I have explained what is an Interface and how it is related to Selenium and what is the difference between Interface and Abstract class. To understand how interfaces work, you will need to know what a class is and how inheritance works, so read up on those first if necessary.</p><p><strong>Table Of Contents</strong></p><p>. Data Abstraction</p><p>· What is Interface?</p><p>· Where Interface concept applied in our real life</p><p>· Types of Interfaces</p><p>· Sample code</p><p>· Interface concept in Selenium</p><p>· Functional Interface</p><p>· Marker Interface</p><p>· Difference between Interface and Abstract class</p><p><strong>Data Abstraction</strong></p><p>In Java, data abstraction is a way of hiding specific details of a class, showing the user only what they need to know. In other words user will have the information on what the object does instead of how it does it. One way to achieve data abstraction in Java is using abstract classes and methods. To make a class or method abstract, you simply define it with the abstract keyword</p><p><strong>Abstract Classes and Methods</strong></p><p>· Classes which are declared with the abstract keyword is known as abstract class in Java.</p><p>· It can have both abstract (method without body) and non-abstract methods (method with body).</p><p>· Abstract classes achieve partial abstraction.</p><p>Examples</p><pre>abstract class CentralBank{<br>  public abstract void minBalance();//method without body<br>  public void neft() {//method with body<br>    System.out.println(&quot;All banks maximum Neft transaction amount should be 50,000 rupees&quot;);<br>  }<br>}</pre><p>The Central Bank class above is an abstract class, so it cannot be used to create an object. Trying to do so will generate an error. To access an abstract class, it must be inherited from another class called the subclass. This subclass must then implement the body of every abstract method declared inside the abstract class. See the example below:</p><pre>public class CanaraBank extends CentralBank {//Canara bank inherits from Central bank and implements its abstract methods.<br><br> public static void main(String[] args) {<br>  CanaraBank cb=new CanaraBank(); //Accessing Central bank class through canara bank class.<br>  cb.neft();<br>  cb.minBalance();<br><br> }<br><br></pre><p>Java interfaces take this a step further by applying abstraction to the entire class, not just specific methods. Now we will get a clear picture what Interface is all about.</p><p><strong>What is Interface?</strong></p><ul><li>Interface is a kind of protocol that sets up rules regarding how a class should behave. Also, we can say it is like a blue print or contract to the class.</li><li>Interface is a group of related methods with empty bodies. It is the class responsibility to implement the methods declared in the body.</li><li>In a nutshell Interface will have method names but no implementation will be done (no body part). But from Java 8 onwards this picture of Interface gets changed which has been discussed in this blog.</li><li>By default, all the methods in the interface are public and abstract.</li></ul><p><strong>Where Interface concept is applied in our real life</strong></p><p>With the help of credit card one can purchase or do any transactions in dollars, or pounds or rupees or any other currency. E-commerce giants like Amazon, eBay all accept credit card payment with different currency. Credit card is like an interface that performs several tasks. Credit card does not hold money in a physical form. Then how the shopkeepers or these online e-commerce companies can get the money. Behind the credit card, have our individual bank a/c details from where the actual money is transferred after authentication. The bank a/c is the implementation class and credit card are an interface.</p><p>Examples</p><pre>public  interface CreditCard {<br> <br> public void purchaseInDollars();<br> public void purchaseInPounds();<br> public void purchaseInRupees();</pre><pre>public class AmericanBank implements CreditCard{<br><br> public static void main(String[] args) {<br>  <br>AmericanBank ab=new AmericanBank();<br>ab.purchaseInDollars();<br>ab.purchaseInPounds();<br>ab.purchaseInRupees();<br>ab.limitInDollar();<br>ab.limitInPounds();<br>ab.limitInRupees();<br> }<br><br> @Override<br> public void purchaseInDollars() {<br>  <br>  System.out.println(&quot;Dollars accepted &quot;);<br> }<br><br> @Override<br> public void purchaseInPounds() {<br>  <br>  System.out.println(&quot;Pounds accepted&quot;);<br>  <br> }<br><br> @Override<br> public void purchaseInRupees() {<br> <br>  System.out.println(&quot;Rupees accepted&quot;);<br> }<br> public void limitInDollar() {<br>  System.out.println(&quot;No max limit for dollars&quot;);<br> }<br> public void limitInPounds(){<br>  System.out.println(&quot;No max limit for pounds&quot;);<br> }<br> public void limitInRupees() {<br>  System.out.println(&quot;No max limit for rupees &quot;);<br> }<br><br>}</pre><p><strong>Interface Concept in Selenium</strong></p><ul><li>For example, to run in Chrome browser Selenium people have developed a class called Chrome Driver. This Chrome Driver class will have all the methods which will help you to automate in chrome browser.</li><li>get (), getCurentUrl(), getTitle(), findElements(), findElement(), quit() and close() are few methods present inside the Chrome Driver, Firefox Driver, Edge Driver and Internet Explorer Driver classes. There are many more methods inside these driver classes.</li><li>To use these methods we create an object of that class. For ex ChromeDriver driver=new ChomeDriver();</li><li>The beauty of Selenium is all these classes will have the same method name,but only inner implementation will change.</li><li>How do these classes have common method names? Here comes the concept of Interface.</li><li>Have you ever understood why we write the code as WebDriver driver=new ChromeDriver(); instead of ChromeDriver driver=new ChromeDriver();</li><li>WebDriver is an interface. Classes like Firefox,Chrome,Microsoft edge etc. will follow the rules imposed by WebDriver interface and each class will implement the methods. You can also refer <a href="https://www.selenium.dev/">https://www.selenium.dev</a> which is the selenium official website where you will find the WebDriver interface and its implementing classes.</li><li>Hence we write the syntax as WebDriver driver=new ChromeDriver(); driver object has access to the methods of Chrome Driver which are defined in Web Driver interface.</li></ul><p><strong>Types of Interfaces</strong></p><p>In general, the interfaces are categorized into</p><p>1.Normal Interface</p><p>2.Functional Interface</p><p>3.Marker Interface</p><p><strong>Normal Interface</strong></p><p>Normal interface is the one were only abstract methods are allowed strictly. No implementation inside the method body.</p><p><strong>Functional Interface</strong></p><ul><li>Functional Interface is introduced from Java 8 onwards.</li><li>Till Java 7 only Abstract methods were allowed.</li><li>If any Interface has only <strong>one </strong>Abstract method it is called as functional interface. To remember usually called as SAM (single abstract method).</li><li>Apart from one Abstract method <strong>any number of static and</strong> <strong>default methods</strong> are allowed in the Interface.</li><li>There is a strong relation between this Functional Interface and Lambda expressions. Again, Lambda expression is introduced from Java 1.8 onwards and that is another separate interesting topic.</li></ul><p><strong>Marker Interface</strong></p><p>It is an empty interface which means no methods. Examples of this interface are Cloneable, Remote and Serializable. This is again a separate topic to be deep dived into.</p><p><strong>Difference between Interface and Abstract class</strong></p><p>In most interviews this is one of the famous question asked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mp14poqzeJnb67FAXd-R_Q.png" /></figure><p>Conclusion</p><p>In this blog we saw what is data abstraction and interfaces and were this concept is related in selenium.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d3406163502" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MOCK SERVERS WITH POSTMAN]]></title>
            <link>https://medium.com/@vshanthipriya/mock-servers-with-postman-d42d1bac8ac8?source=rss-81d6f79878a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/d42d1bac8ac8</guid>
            <dc:creator><![CDATA[Shanthi Priya]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 17:07:26 GMT</pubDate>
            <atom:updated>2023-03-10T17:07:26.080Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2KPMLY2pYxYPHz3P.png" /></figure><p>In this blog have discussed what is mock server and how to create a mock server in postman. We know real servers. What is mock server then? What is the necessity of creating mock servers? Mock servers are used to help solve many different testing problems. They can help you control what inputs the UI gets, and they can be used to help drive better designs and to better understand how an API works. In many ways the ability to create and use mock data is essential to good API testing and development.</p><p><strong>Table Of Contents</strong></p><p><strong>1. What is Mock Server</strong></p><p><strong>2. Need to Create Mock Server</strong></p><p><strong>3. Mock Server Creation</strong></p><p><strong>4. Functional mocking examples</strong></p><p><strong>5. Conclusion</strong></p><p><strong>What is Mock Server</strong></p><p>A mock server is not a real server and it is created to act and function as a real server to verify APIs and their responses.</p><p><strong>Need to Create a Mock Server</strong></p><p>1. Mock server is used if we want to avoid sending requests on real time data. One example is let us imagine an online store that uses a credit card service by calling the API. When testing that store, you might not want to send the credit card details to the credit card service, so instead create a mock server that you send these details to. Doing this allows you to test the application without needing to call the actual credit card service .</p><p>2. A Mock server is used if the APIs to be tested are still in development.</p><p><strong>Mock Server Creation</strong></p><p>In this section we will see how to create a mock server in postman. To create a mock server click the mock servers field in the left side which I have marked with red color. Next click the plus symbol at the the top.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*D0q8v2wCHGK3qSZq.png" /></figure><p>Next click create a new collection as we are designing this mock server from scratch. Under Request URL tab have entered the resource name as /getallcoursedetails. Usually these URL will be different in each environment when we run our test cases. Need not worry about the prefix of the server. Once we create a mock server a URL will be generated . The request method is selected as GET as the resource call is of GET type. Then enter the response code as 200 and enter the sample response body . This sample JSON response body will be usually created by the testers from the JSON Schema given by the developers. Sometimes developers give the sample response body also. All these details will be found in the contract document given by the developers.</p><p><strong>Example 1 :</strong></p><p>{{base_url}}/getallcoursedetails</p><p>{{mock_server_url}}/getallcoursedetails //getallcoursedetails is called as the resources.</p><p><strong>sample JSON body:</strong> //This we will enter in the response body field.</p><pre>{<br>&quot;data&quot;:[<br>{<br>  &quot;Course&quot; :&quot;Selenium&quot;,<br>  &quot;Price&quot; : &quot;150&quot;,<br>  &quot;Category&quot; : &quot;Java&quot;<br>},<br>{<br>  &quot;Course&quot; :&quot;Cypress&quot;,<br>  &quot;Price&quot; : &quot;150&quot;,<br>  &quot;Category&quot; : &quot;Java&quot;<br>},<br>{<br>  &quot;Course&quot; :&quot;Rest Assured&quot;,<br>  &quot;Price&quot; : &quot;100&quot;,<br>  &quot;Category&quot; : &quot;Java&quot;<br>},<br>{<br>  &quot;Course&quot; :&quot;Postman&quot;,<br>  &quot;Price&quot; : &quot;50&quot;,<br>  &quot;Category&quot; : &quot;Java Script&quot;<br>}<br>]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*xcqnRjpCdFzhM4-n.png" /></figure><p>After adding all the details click on next. Under the mock server name field can give any name. I have given Mock server demo. Then click create mock server tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*9kGQnXC3Sd5xRyxg.png" /></figure><p>After clicking the create mock server tab a URL will get generated. The generated URL is highlighted in red color.</p><p>Can copy the URL. This URL is the server where you have to send your request. We will get the response whatever we configured back after sending the request to the mock server created. We can start writing the automation script with dummy data and later once the APIs are ready can flip to real data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*Hvk2lxEBuIQlu8Jy.png" /></figure><p>The base URL will be constructed as <a href="https://dff84082-367f-46bc-88e4-cee0eba22d14.mock.pstmn.io/getallcoursedetails">https://dff84082-367f-46bc-88e4-cee0eba22d14.mock.pstmn.io/getallcoursedetails.</a> After creating the mock server come back to the collection tab. We can see one collection created automatically. When we expand it we will have the get call which we configured before . In below screen shot we can see the mock server demo collection created. We can see the response in the response body and the status code after sending the request to the mock server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*lziDXNCchX6Cl8BE.png" /></figure><p><strong>Functional mocking Examples</strong></p><p>We can see a default example created under the get call. This is one example what we configured before. Like this multiple examples can be configured. In postman terms its adding an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/0*1WshC0zi_RvyK09W.png" /></figure><p>We are going to send another request. The resources and the JSON body will be given by the developers. Need not go to mock servers and create one more. In existing collection itself can add a request . We might wonder then how the required status code, response body and get call will be configured. This is were the examples comes into picture.</p><p><strong>Example 2:</strong></p><p>{{base_url}}/getcoursedetails?name={{course}}</p><p>sample Json Body</p><pre>{<br>  &quot;name&quot;: &quot;postman&quot;,<br>  &quot;category&quot;: &quot;java script&quot;,<br>  &quot;students&quot;:&quot;1232&quot;<br>}</pre><p>After clicking the collection named mock server demo click the three dots near it and click add request. In the add request add the URL mentioned above . How to configure the status code and the response body? Near the save button in the right corner we see three dots. After clicking three dots add example has to be clicked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aveYzrdfKinrxVFi.png" /></figure><p>Any name can be given for the add example. I have given postman course details. Enter the JSON body and the status code. After clicking save now try calling the get course details call . Here in resource name have hard coded as postman. You can try with any names. The request call made will hit the mock server and fetch the details in the response body which we configured with the help of creating examples. Like this many examples can be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*SKXH9Y3BfYyIzNWx.png" /></figure><p><strong>Conclusion</strong></p><p>In this blog we have seen what is a mock server and what is the need to create a mock server and how it is created with few practical examples. Postman gives us an option to create mock server . You can create you own mock server and JSON body and try out in postman.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d42d1bac8ac8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ENVIRONMENTS AND VARIABLES IN POSTMAN]]></title>
            <link>https://medium.com/@vshanthipriya/environments-and-variables-in-postman-e1d3a0fce4b?source=rss-81d6f79878a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1d3a0fce4b</guid>
            <dc:creator><![CDATA[Shanthi Priya]]></dc:creator>
            <pubDate>Fri, 10 Mar 2023 16:59:57 GMT</pubDate>
            <atom:updated>2023-03-10T16:59:57.193Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong></p><p>In this blog we will see what is the need of Environments and Variables and how to use them in Postman. In real time we will be having a QA environment where we test all our APIs and move our code to the UAT environment. Base URL will get changed as QA will point to one server and UAT to another server. Before going to the theory part lets see few practical examples first as it will be easier to understand the definitions. Environments allow us to define a set of variables that belong to a certain context. Since I cannot expose the APIs which I worked on in my company one can try out with many free APIs available in GitHub for practice. The sample API which I have used for practice is <a href="https://swapi.dev/api"><strong>https://swapi.dev/api</strong></a></p><p><strong>How to use Environments and Variables in Postman</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*lJMsK1B-pFOdGccM.png" /></figure><p>In the above screenshot of Postman, I have marked the Environments field in blue color and the sample collections which I created in red color for a better clarity for the beginners. When Environments tab is clicked, we can see the plus sign in the top left of our postman screen. This plus sign is for creating a new environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*nwtWyDT8dsUyC8Di.png" /></figure><p>After clicking the plus symbol a new environment tab gets created which I have marked in green color. This can be named based on the requirements of your project and the environment where we will be testing our APIs.. For demo purpose have named one as <strong>QA and another one as Json placeholder Env</strong>. The yellow color marked area is where we set our variable and the initial value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*JU1T33Jd2-yba_5V.png" /></figure><p>Under variables have entered base_url and set the initial value as <a href="https://swapi.dev/api/">https://swapi.dev/api/</a>. Like this we can create many variables and use them in our pre-request script and tests dynamically. After entering the value click save. The current value will get assigned automatically during run time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*w442Mc9c0cBsaNBq.png" /></figure><p>Now instead of giving the entire base URL we can change it to the variable name which we set in the environment Json placeholder Env. The format will be like this with double curly braces{{base_url}}. I have set the variable name as base_url. Any name can be given. If we hover our mouse we can see the variable initial value set and the scope of the variable whether set in global or collection level. This I have discussed below. We must make sure before we run our tests if appropriate Environment is selected. The red color indicates that. Some times the Test lead might ask us to run our tests in QA or any environment as required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/0*bc_mR7Cztm7dItVn.png" /></figure><p>The above screenshot shows the initial, current and the scope of the variable when the mouse is hovered on the base_url.</p><p><strong>Variable Scopes</strong></p><p>Now after seeing basic practical examples, we can understand the theory part very well.</p><p>1.As said in the beginning of this blog Environment is a set of variables one can use in your postman requests.</p><p>2.Variables allows us to store and re-use values in our scripts and requests.</p><p>3.By storing a value in a variable as we saw above one can reference it throughout the collections, environments, and requests, and if we need to update the value, we only have to change it at one place.</p><p>4.Using these variables, it increases our ability to work efficiently and minimizes the likelihood of error.</p><p>Postman supports the following variable scopes:</p><p>· Global</p><p>· Collection</p><p>· Environment</p><p>· Data</p><p>· Local</p><p><strong>Global-</strong> Global variables are available to all requests available in the Postman console regardless of which collection they belong to. These variables are general purpose variables and, as a best practice, should mostly be avoided: otherwise, you’ll get a crowded global space and you won’t know which variable belongs to which API.</p><p><strong>Environment</strong>- Environment variables have narrower scope than global variables. If your collection needs to run against different servers, such as localhost, test server, pre-prod and prod, you can easily switch environments. Even if you have one server / API only, it might still be useful to use environment variables as it would keep the variables away from global namespace otherwise it can get crowded. In this case, however, you can choose to use collection variables too but environment variables give you different access levels when working as a team. You can assign the same role in the workspace or configure roles, such as viewer, editor etc. on an individual basis. Environment variables should be used for environment specific information such as URLs, username and password.</p><p><strong>Collection- </strong>A collection is a group of Postman requests that are related to each other. Collection variables are used to define variables at — guess where — the collection scope. Collection variables are available throughout the requests in a collection and are independent of environments.</p><p><strong>Local- </strong>Local variables are temporary and only accessible in your request scripts. Local variable values are scoped to a single request or collection run, and are no longer available when the run is complete.</p><p><strong>Data- </strong>Data variables come in the context of request execution through the collection runner. Postman allows us to execute requests in a collection through the collection runner and we can provide a data set in the form of JSON or CSV that are used while running the requests inside the collection so the source of data variables is the user-supplied data file in the format of JSON or CSV. During the request execution, the data variables can only be fetched but not updated/modified or added.</p><p>Postman official document says if more than one variable with the same name is available to a request, Postman will use the value from the variable with narrowest scope. This means that if you have an environment variable with the same name as a collection or global variable, Postman will use the environment variable, but local and data variable values will supersede environment values. The value of any overridden variables will display with a strikethrough. To know more about Postman, we can refer their official site <a href="https://learning.postman.com/docs/introduction/overview/">Overview | Postman Learning Center</a> which has many helpful documentations.</p><p><strong>Summary</strong></p><p>Postman environments are a place where you can create and manage variables. You can set up multiple environments for different purposes. Environments are very helpful when you need to share data between requests. If you are beginner go through the postman official documentation before watching any You tube or reading any blogs. Happy API Testing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1d3a0fce4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SELENIUM WEBDRIVER ARCHITECTURE]]></title>
            <link>https://medium.com/@vshanthipriya/selenium-webdriver-architecture-c4d7a72a474?source=rss-81d6f79878a2------2</link>
            <guid isPermaLink="false">https://medium.com/p/c4d7a72a474</guid>
            <dc:creator><![CDATA[Shanthi Priya]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 23:36:23 GMT</pubDate>
            <atom:updated>2022-09-30T23:36:23.347Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/762/0*B0_mWarg_Ut5IdZm.JPG" /></figure><p><strong>Overview</strong></p><p>Selenium Web driver is one of the most widely used tools for automating web applications. By far it is the most important component of Selenium Suite. It provides different drivers for different browsers and supports multiple programming languages. This article describes about Selenium WebDriver Architecture and to know about how selenium works internally.</p><p>The above picture depicts, there are four components of Selenium Architecture:</p><p>1. Selenium Client Library</p><p>2. JSON Wire Protocol over HTTP</p><p>3. Browser Drivers</p><p>4. Browsers</p><p>We will try to understand each of these four components briefly:</p><p><strong>1. Selenium Client Library</strong></p><p>Selenium supports multiple libraries such as Java, Ruby, Python, etc.</p><p>It means that we can write our code with any of these scripting/programming languages in our IDE.</p><p>After we trigger the test, the complete selenium code written in the IDE will be converted into the JSON format in the backend.</p><p><strong>2. JSON Wire Protocol over HTTP</strong></p><p>JSON stands for JavaScript Object Notation. It is a lightweight data-interchange format which transfers the data between a server and a client on the web. JSON wire protocol acts as a mediator between client libraries and Web Drivers. Because servers do not understand programming languages, JSON Wire Protocol uses the process of serialization (converting object data to JSON format) and de-serialization (converting JSON format to object). JSON Wire Protocol has REST APIs working over HTTP.</p><p><strong>3. Browser Driver</strong></p><p>Browser Drivers are used to communicate with browsers. Each browser has its specific Browser WebDriver. Each of the browsers has separate drivers, which can be downloaded from Selenium’s official repository.</p><p>Generated JSON is sent to Browser Driver (server)through http protocol.</p><p>Browser Driver receives the response back from the browser and it sends the JSON response back to the client.</p><p>We set the path of the driver downloaded in our code which is mandatory for our selenium script to get connected to the browser driver.</p><p><strong>4. Browsers</strong></p><p>Selenium supports multiple browsers such as Firefox, Chrome, IE, Safari etc.</p><p>Real browsers receive the requests from their browser driver and operate on the application elements according to the request. The browser responds back to its browser driver with the output and the browser driver in turn sends back the response received through JSON format via http protocol to the client.</p><p>This is how Selenium WebDriver works internally but Selenium 4 has migrated from JSON wire protocol to W3C WebDriver protocol.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pZzu53RZ9ctHRhc8.jpg" /></figure><p>W3C is a standard approved by World Wide Web Consortium for designing all the web applications and browsers. Browsers like Firefox, Chrome, IE, Safari etc. and executables (drivers) were following W3C protocol. But Selenium API alone was not following W3C protocol in earlier versions of Selenium. From Selenium 4 onwards JSON protocol is no longer followed and is replaced with W3C. Hence Selenium API, Driver and browsers all commonly follow W3C protocol which makes the communication between them much faster and easier.</p><p><strong>W3C Advantages</strong></p><ul><li>Automated tests will run more consistently between different browsers and devices since they all implement the same standard.</li><li>The protocol has been developed having in mind stability. Therefore, it is expected that as a consequence the test cases written in Selenium will be much more stable.</li><li>You can do things like multi-touch actions, press two keys at the same time, and zoom, among others.</li></ul><p><strong>Conclusion</strong></p><p>In a nutshell in layman’s term our code what we write in our IDE is not directly interacting with the browser. In the middle there is a server called Browser Driver which is responsible to automate on the browser. This is how the Selenium WebDriver Architecture works internally.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c4d7a72a474" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>