<?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 Bharateeshd on Medium]]></title>
        <description><![CDATA[Stories by Bharateeshd on Medium]]></description>
        <link>https://medium.com/@bharathish?source=rss-5347af80613d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*BiuV7TV31Su-Jc84Bvqc8g.jpeg</url>
            <title>Stories by Bharateeshd on Medium</title>
            <link>https://medium.com/@bharathish?source=rss-5347af80613d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:33:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bharathish/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[Selenium Getting Started — Hello World]]></title>
            <link>https://medium.com/@bharathish/selenium-getting-started-hello-world-c65250e31c8f?source=rss-5347af80613d------2</link>
            <guid isPermaLink="false">https://medium.com/p/c65250e31c8f</guid>
            <category><![CDATA[java-selenium]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[java-automation-testing]]></category>
            <dc:creator><![CDATA[Bharateeshd]]></dc:creator>
            <pubDate>Wed, 23 Mar 2022 10:38:20 GMT</pubDate>
            <atom:updated>2022-03-23T10:38:20.415Z</atom:updated>
            <content:encoded><![CDATA[<h3>Selenium Getting Started — Hello World</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BA3uTzPFrBsYxFsR" /><figcaption>Selenium Getting Started</figcaption></figure><h3>This post helps you to get your feet wet in selenium..</h3><h3>What is Selenium and Why?</h3><p>Well if you have a basic knowledge of Java the you’ll be having an idea of what is a library or jar file. Libraries are pre written Java code for specific purposes so that they can be included in a Java project whenever required.</p><p>Selenium is one of such kinds of open source and insanely popular Library(s) where the code for automating a user interaction with a browser is pre written. So as soon as we add selenium libraries to our project we’ll be having all the features that we need to simulate the actions of a user on browser. As Selenium defines itself.,</p><p>“Selenium automates browsers. That’s it! What you do with that power is entirely up to you.”</p><p>For more details head to Selenium’s website — <a href="https://www.selenium.dev/">Selenium</a>.</p><h3>Set up</h3><p>We’ll be using Eclipse IDE from now on for all our automation scripts. (Of course you can choose your IDE of preference). Assuming you’ve installed Java in your machine.</p><ol><li>Download and unzip Eclipse IDE for Java Developers <a href="https://www.eclipse.org/downloads/download.php?file=/oomph/epp/2019-06/R/eclipse-inst-win64.exe">from here</a>.</li><li>Download the selenium library <a href="https://www.selenium.dev/downloads/">from here</a>.</li><li>Download the driver for your preferred browser. (For this example we use google chrome) Assuming you have Google chrome installed in your machine, download chrome driver <a href="http://chromedriver.chromium.org/downloads">from here</a>.</li></ol><h3>Getting Started — Hello World !</h3><p>Once above mentioned set up is done.</p><h4>Create a Java Project in Eclipse.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZVSCttzmm0m97fwE" /><figcaption>Creating Project In Ecli</figcaption></figure><h4>Add Selenium library (.jar) to your build path.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_EJWslLh2sak_3H0" /><figcaption>Add Selenium library (.jar) to your build path</figcaption></figure><h4>Create a Java class with a main method and call it HelloWorld.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*P4AIu1MKdO5VSQU8" /><figcaption>Create a Java class with a main method and call it HelloWorld</figcaption></figure><h4>Place the downloaded chromedriver directly under your project folder.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nByvPZwuzzXgQeFT" /></figure><h4>Now write the following code in your main method.</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/21af6bba06e782e3fd45c208bebe9dfb/href">https://medium.com/media/21af6bba06e782e3fd45c208bebe9dfb/href</a></iframe><h3>HelloWorld Explained</h3><p>Now let’s see what’s happening in these 3 lines of code.</p><p>In the world of Java everything is object. And every object is an instance of a class which defines the objects behavior and state.</p><p>Now in this example we are basically using 2 of such major objects.</p><ol><li>WebDriver</li><li>WebElement</li></ol><p>WebDriver: Is the object representation of our browser. Let it be Chrome, Firefox, Safari etc.,</p><p>WebDriver is an Interface in selenium library, implementation of which comes from different vendors like Google Chrome, Firefox, Safari etc.,</p><p>These implementation are concrete in nature and contain the implementation for interaction methods which are defined in WebDriver interface.</p><p><strong>For example</strong>:</p><pre>WebDriver driver = new ChromeDriver();<br>driver.get(&quot;https://www.google.com/&quot;);</pre><p>Here get is a method defined in WebDriver interface which navigates to the specified url. Here the implementation is coming from ChromeDriver class which has implementation of get method.</p><p><strong>WebElement:</strong> Is the object representation of each element present inside the browser. All the links, buttons, forms, form inputs, images, basically anything in the browser can be a WebElement.</p><p>In our example we’ve now explicitly mentioned it but we are using it. The third line can be written like this also,</p><pre>WebElement searchInput = driver.findElement(By.name(&quot;q&quot;));<br>searchInput.sendKeys(&quot;Hello World...&quot; + Keys.ENTER);</pre><p>The line</p><pre>WebElement searchInput = driver.findElement(By.name(&quot;q&quot;));</pre><p>Creates a WebElement object which represents the search input. And it has all the methods that a user wants to perform on a web element. Like click, sendkeys (typing), getting value of it etc.,</p><p>Finally driver.close() closes the current working window. And driver.quit() closes all open windows of that particular browser.</p><blockquote>Congrats on your first selenium script. 😊</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c65250e31c8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>