<?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 Sukanya Ravinder on Medium]]></title>
        <description><![CDATA[Stories by Sukanya Ravinder on Medium]]></description>
        <link>https://medium.com/@sukanya.ravinder?source=rss-6b5c2217950b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AEULUqo9Pa3VxKCy</url>
            <title>Stories by Sukanya Ravinder on Medium</title>
            <link>https://medium.com/@sukanya.ravinder?source=rss-6b5c2217950b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 09:00:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sukanya.ravinder/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[Running Selenium automation testcases using Jenkins]]></title>
            <link>https://medium.com/@sukanya.ravinder/running-selenium-automation-testcases-using-jenkins-db3484b3ff10?source=rss-6b5c2217950b------2</link>
            <guid isPermaLink="false">https://medium.com/p/db3484b3ff10</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[allure-reporting]]></category>
            <dc:creator><![CDATA[Sukanya Ravinder]]></dc:creator>
            <pubDate>Fri, 03 Dec 2021 21:23:48 GMT</pubDate>
            <atom:updated>2021-12-03T21:23:48.667Z</atom:updated>
            <content:encoded><![CDATA[<p>So far we have run testcases from Maven by using Selenium and TestNG. We also generated Allure reports . Please read this <a href="https://medium.com/@sukanya.ravinder/allure-report-using-testng-and-maven-18d6d24e997d">blog </a>for the steps.</p><p>But now what If we need to run this using a DevOps tools like Jenkins. What is Jenkins?</p><blockquote>Jenkins is an <strong>open source continuous integration/continuous delivery and deployment (CI/CD) automation software DevOps tool</strong> written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.</blockquote><p>Lets try to implement this. This is totally self learned so I am open to more improvements and suggestions :)</p><p>I am using the source code management tool like <strong><em>GIT </em></strong>for this purpose.</p><p>To begin with we need to push our code into git repository and should have installed Jenkins. You can refer to this <a href="https://www.jenkins.io/doc/book/installing/windows/">link </a>for Jenkins setup</p><p>Please ensure Jenkins is up and running in your system.</p><p>If you are successful in setting up Jenkins you should be able to see a screen as below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S-Db9u-H7Dzj4Qn2fYMO9Q.png" /></figure><p>Sign on into Jenkins using the user and password credentials which you setup.</p><p>The main screen will load and you can see this screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VH4PnmtTC-ogZWcj7ZNSxA.png" /></figure><p>I already have two builds configured but we will see how to create a build from scratch to run testcases.</p><p>Click on <strong><em>New Item</em></strong> in the left side menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/329/1*mJv5T-aZ6UDLi8HEkS5l2g.png" /></figure><p>You should see a screen for providing project type settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nwIGWitHdodUxxb4THJIKg.png" /></figure><p>Give a name for your build. We are going to run Allure reports and test cases so I have named it as <strong><em>AllureReportDemo </em></strong>and since this is a maven project, we will select project type as <strong><em>Maven project. </em></strong>Click Ok. <strong><em>(If Maven Project is not visible then go to Manage Jenkins on the main menu, then install the Maven plugin)</em></strong></p><p>You will be directed to the configuration section for your build.. There are multiple things you can configure for your build depending on the requirements for your project , for now we will go with just basics for a test case to run. Please go ahead and explore more features to implement.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7JouZ-sICGhVQm6uCaY_Hw.png" /></figure><p>In <strong><em>General </em></strong>tab, we can provide a description for the build. We will be selecting <strong><em>GitHub project</em></strong> option because we are going to use the project we have in git to run through the Jenkins build. Once the option is selected, you will provided with a textbox to fill in the <strong><em>Project URL</em></strong> . This is nothing but your URL you see in your GitHub web page when you navigate to your repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fe4hPLNaxBmgi6TDwL7BFg.png" /></figure><p>Once you specify that, click on the <strong><em>Source Code Management</em></strong> tab and choose <strong><em>Git</em></strong></p><p>You will prompted to enter the repository URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dP9XxvcUi4YMjkXIwP_VbA.png" /></figure><p>You can find this URL by going to your GitHub repo and clicking on Code button on the right side. You will get a dropdown which will contain the https link . Copy that link and paste it here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*lfd4JVcOpps_iYJz5ANLdQ.png" /></figure><p>Next step is to check if the branch is correct. My branch is called <strong><em>APITesting</em></strong>. The default branch is always <strong><em>master. </em></strong>You need not do anything if your branch is master. Else you have to specify the branch name as below. You could also click on “<strong>? “ </strong>to see the ways of writing a branch specifier</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RgfON8LzB6GnHiYyDpoD4g.png" /></figure><p>Under Additional Behaviors there are a variety of options again we can use them to our discretion depending on the project requirements. For now I am selecting the last one which is <strong><em>Wipe out repository and force clone. </em></strong>Basically this will delete the entire repository which is stored locally by Jenkins and clone the repository from git for every run of the build. This is one way to ensure we have the updated build from Git for each run. But we can also configure Jenkins to run the build every time a commit is being made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pFGirDRDSYBxWsmYA4A8DQ.png" /></figure><p>By default the first option is selected, we can remove it and we select the option as mentioned below. Basically this is going to pull from GitHub if a push or a commit is made. For that purpose we can schedule a particular time as well by clicking the Poll SCM option. For now we will manually run the build.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nvvn8nI3kg_NBfNGLHScAw.png" /></figure><p>Coming to <strong><em>Pre Build </em></strong>section, we have to provide the path to the POM xml and what&#39;s the build supposed to do. I have mentioned as <strong><em>clean install test.</em></strong></p><p>This means that the project will undergo a cleanup and then do a build which will install all the required maven dependencies from POM and then start the test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pDbOwpPt2XXuKe798ISN3g.png" /></figure><p>In Post Build section, I am not changing anything for now, but feel free to explore all other options. You can also choose the first option if you want the testcases to run only if the build is successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OUnE1ccPEqFy2Yo7EpjKdA.png" /></figure><p>Last is <strong><em>Post Build Actions. </em></strong>Here we are going to select Allure Report because our project is going to run testcases and generate reports</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*fvUmruGkHhIi9WmK0eOriQ.png" /></figure><p>Now if you are not able to see this option, it means that you have to install the <strong><em>Allure Report plugin</em></strong>. To do so, follow the below steps.</p><p>Go back to the main menu and select <strong><em>Manage Jenkins</em></strong> (Click on Save first!!)</p><p>Under System configuration select <strong><em>Manage Plugins</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NY3mqfVOovzMWIC7Jb3glw.png" /></figure><p>Select the Available tab and search for allure you should be able to see a plugin called <strong><em>Allure Jenkins plugin. </em></strong>Click on install. I have already installed it so I am able to see in under Installed tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*83HU8yAASzGrhE-uPgr_yw.png" /></figure><p>Once that is installed you can login again into Jenkins as a refresh and then click on your build and select <strong><em>Configure </em></strong>from the left menu. You should be redirected to your configuration page.</p><p>Once there you can go to the end and select dropdown and you should be able to see Allure Report as a option.</p><p>Configure your allure reports path from your project over here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WCjQ5a0VUy6hMd5lReT6iw.png" /></figure><p>That&#39;s it we are done with a basic level configuration. Click on Apply and Save and then we should be able to see a screen as below. Note that a link for Allure Report is appearing here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uXK3KtG7LR4Ie8AAPK3baA.png" /></figure><p>Click on <strong><em>Back to Dashboard</em></strong> option and you should be able to see the build in the list.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AYWEzbS5cT9-jyhy-nPuMg.png" /></figure><p>We have created the build . Now lets run the build to see if we are able to execute the test cases and generate allure reports . All you need to do is to click the icon on right end that will trigger a build.</p><p>Once you click on it, in the left side bottom you should see it running, #3 means it is running for the 3rd time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*oT6NBZdvwED2TsWuMe2zQw.png" /></figure><p>After the execution is complete click on the build name , you should see a screen as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*22V2fWqFpEXfjcqG_vZMTg.png" /></figure><p>Since you installed and ran allure reports you can see a icon for allure report in the page. We can also see the number of times this build has run. Lets try to view logs files. For that click on the last build run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vqcaMXcKZvn3arKPilVMsw.png" /></figure><p>Here on the left side , click on Console Output to view all the steps executed as part of this build. This is very useful to find out where the build has gone wrong if the build did not run successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2e4XKLVBg1jgcIXaOvehdw.png" /></figure><p>You can also view TestResults similar to TestNG by clicking on <strong><em>TestResults </em></strong>link</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HfsDYuI6WypJrshWn14bHw.png" /></figure><p>Now in order to view the allure report, click on the Allure Report link on the page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mf-xVtXHXdXGQIcJ8qPtgw.png" /></figure><p>Great!! we are able to view the same allure report which we see after the test case is executed. And also we see the executors on the right side below is mentioned as Jenkins.</p><p>This is a basic flow of steps on how to run a testcase using Jenkins and Git.</p><p>Hope this was useful. Happy Automating!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db3484b3ff10" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to run browser from Selenium without using System.setProperty]]></title>
            <link>https://medium.com/@sukanya.ravinder/how-to-run-browser-from-selenium-without-using-system-setproperty-7beab11f31d0?source=rss-6b5c2217950b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7beab11f31d0</guid>
            <category><![CDATA[testng]]></category>
            <category><![CDATA[selenium-webdriver]]></category>
            <dc:creator><![CDATA[Sukanya Ravinder]]></dc:creator>
            <pubDate>Tue, 21 Sep 2021 14:39:06 GMT</pubDate>
            <atom:updated>2021-09-21T14:39:06.594Z</atom:updated>
            <content:encoded><![CDATA[<p>Every time we run a web test from Selenium we have to manually set the path of the Chrome Driver exe and then run the test.</p><p><strong><em>But what if we can run it without setting the path in the System .setProperty!!</em></strong></p><p>Yes it is possible. It is easy and simple. First go to maven repository and search for <strong><em>webdrivermanager. </em></strong>Click on the first link and pick the maven dependency<strong><em>. </em></strong>I have used<strong><em> 3.7.1 </em></strong>version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*1CZNVmti7-zj_jCttph57Q.png" /></figure><p>Clean and build the project and the maven dependencies should show the one added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Hjs1S05Xg7gdKUeDaaOeUQ.png" /></figure><p>That&#39;s all . You are now set to test the website without the <strong><em>setProperty</em></strong>. Now go to your code or create a new testNG class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/637/1*Y8wOg43stkdtbElUBUYO0Q.png" /></figure><p>In BeforeTest method, provide the following line in the beginning</p><p><strong><em>WebDriverManager.chromedriver().setup();</em></strong></p><p>This ensures that your webdriver manager uses the chromedriver for the test.</p><p>The next two lines are used to initialize your webdriver and open the website.</p><p>Right click on file and run as TestNG</p><p>That&#39;s it. You will be able to see the chrome open as usual now with just a difference of omitting the <strong><em>System.setProperty(). </em></strong>You can use this approach for any browser.</p><p><strong><em>Say goodbye to the System.setProperty.</em></strong></p><p>Happy testing!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7beab11f31d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Allure Report — using TestNG and Maven]]></title>
            <link>https://medium.com/@sukanya.ravinder/allure-report-using-testng-and-maven-18d6d24e997d?source=rss-6b5c2217950b------2</link>
            <guid isPermaLink="false">https://medium.com/p/18d6d24e997d</guid>
            <category><![CDATA[maven]]></category>
            <category><![CDATA[testng]]></category>
            <category><![CDATA[allure-reporting]]></category>
            <dc:creator><![CDATA[Sukanya Ravinder]]></dc:creator>
            <pubDate>Mon, 20 Sep 2021 20:34:14 GMT</pubDate>
            <atom:updated>2021-09-20T23:50:04.736Z</atom:updated>
            <content:encoded><![CDATA[<h3>Allure Report — using TestNG and Maven</h3><p>We would be following the below steps for creating and viewing Allure Reports</p><ol><li>Create a New Maven Project and Update pom.xml with required Dependencies.</li></ol><ul><li>TestNG</li><li>Selenium java</li><li>Allure-TestNG</li></ul><p>2. Download Allure Binaries then set path.</p><p>3. Check Allure version.</p><ul><li>allure — version</li></ul><p>4. Create TestNG TestCases then run through TestNG.XML</p><p>5. Then, run below command in Windows command prompt:</p><p>allure serve &lt;Path of Allure Json&gt;</p><p><strong>Now, Let’s Dive In</strong></p><p>Go to Eclipse and Create Maven Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*vlJTBVjGUfjEycibTZLgvg.png" /></figure><p>Select Maven Project under Maven Folder and click on ‘Next’ Button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/686/1*H3tYYoWL1fcU8F05-6WDfA.png" /></figure><p>Click on the Next button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6k8vgU6D3NMva8pmAIrbSA.png" /></figure><p>Give ‘<em>GroupId</em>’ and ‘<em>ArtifactId</em>’</p><p><em>groupid</em>: An XML element in the POM.xml file of a maven project that Specifies the id of the project group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nKZCYx5EEe4Ms51IuRWwLg.png" /></figure><p>There are several elements in the POM.XML file. The &lt;<em>project</em>&gt;is the root element. The &lt;<em>modelVersion</em>&gt; specifies the model version while the &lt;<em>version</em>&gt; specifies the version of the artifact under the given group.</p><p><em>artifactid</em>: An XML element in the POM.xml of a Maven project that specifies the id of the Project (artifact)</p><p>Now add below-mentioned dependencies in Pom.xml file</p><ul><li>TestNG — Java testing framework</li><li>Selenium java — To automate browser</li></ul><p>Allure-TestNG — To generate the report.</p><p>Copy the maven dependencies for <em>allure-testng</em>. I have used the<em> 2.13.0 </em>version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IzoiXIfy606fbGes8JnoSw.png" /></figure><p>Once you add Dependencies, go to Your project and Update the Project as below.</p><p><em>Project -&gt; Right-Click -&gt; Maven -&gt; Update Project.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*ptoQzVfxM_cQC3_ZSwguyg.png" /></figure><p>All dependencies should be available under the ‘Maven Dependencies ’ Section. Once Done Now maven Project is Ready.</p><p>The Next Step is to generate “Allure Report”. we need to download allure binaries from maven.</p><p><a href="https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.13.0/">https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline/2.13.0/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*YcuCN-LgZM3v4hdrBWiQEg.png" /></figure><p>Download the zip file , unzip the file in the desired location. Copy the location up to bin folder, add it to Environment variables to path system variable just like you did for maven.</p><p>Now Verify Allure Binaries are configured properly or not, open command prompt and check for version.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eIZD64xGs_4kO_KzTit9pg.png" /></figure><p>Create TestNG TestCases then run through TestNG.XML</p><p><strong><em>BaseClass </em></strong>is a class that is used to initialize the webdriver</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nADyMfMbdc9CMIHNid4MOg.png" /></figure><p>Tests is a TestNG class that has all the tests to run a simple login into a website and fetch page title and perform assertions for the same.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*krQtViKB2YXhFHCEyBFFSQ.png" /></figure><p>Now Create the TestNG File Right-click on file -&gt; Go to TestNG -&gt; Convert to TestNG</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*7ts7OHgPeMlBVvYS1GNKWg.png" /></figure><p>After TestNG xml is created , right click anywhere inside TestNG and runas TestNGSuite</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LHWY5n9lFcCPdbu2fULycg.png" /></figure><p>Once the test scripts execution has completed. Go to Your Project and refresh it</p><p>After refreshing Project automatically one folder is generated &lt;allure-results&gt; if you expand it you can see many JSON files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/291/1*u5moyYZYnx4OeNph8coZQA.png" /></figure><p>To see Report run Below Mentioned steps</p><ul><li>Right click on &lt;allure-results&gt; folder &gt; Properties&gt;copy folder path</li><li>open Command Prompt</li><li>Run This Command-</li></ul><p><strong><em>allure serve &lt;folder-path&gt;</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*Msa30yIMqODZJez0_SnfPw.png" /></figure><p><strong><em>Congratulations Allure Report is getting Generated</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJtDfWUyFlcx6k-rlpLiFQ.png" /></figure><p>Up till now, we have seen basics to generate allure report, now we will see How to customize it by adding different types of annotations and also, we will how to add a screenshot on failure Test cases.</p><p>Here, is the annotations from Allure</p><p><strong>@Epic :</strong> Epics are useful as placeholders for large requirements for your product or project. Epic will be divided into smaller user stories at the appropriate time.</p><p><strong>@Stories/@Story :</strong> A User Story can be split to smaller Tasks, and can be part of some larger Feature and Epic.</p><p>For a better understanding of the difference between epic, feature and user stories, below is a picture with each activity in Agile.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/0*N6VIp7G3bTMcaSPy.png" /></figure><p><strong>@Severity :</strong> In allure, we can define any @Test with @Severity annotation with any of these values like BLOCKER, CRITICAL, NORMAL, MINOR, TRIVIAL. By looking at this, we can understand the Severity of test if Failed.</p><p><strong>@Description(“In this cool test we will check cool thing”) :</strong> We can add detailed description for each test method/class using @Description annotation</p><p><strong>@Step : </strong>We can annotate any method with any visibility modifier (public, private, protected) with @Step annotation. Ex — <em>@Step(“Entering {0} and {1}”)</em></p><p><strong>@Attachment : </strong>An attachment is simply a method that returns either a String or byte[], which should be added to the report.</p><p><strong>@Link : </strong>We can link tests to some resources such as TMS (test management system) or bug tracker. This is always helpful to link test cases to the test method.</p><p>These annotations are used in the same way like we use TestNG annotations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*kWgSpLWlFbqm4jYH2bvGFA.png" /></figure><p>Now run the test suite and refresh the reports and view again using allure serve. Now we have reported with annotations in Behaviors section</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ct65OODJEYA6NNBSGSs2xw.png" /></figure><p>Now to Add Screenshot we need to add pom.xml with some additional information. Add the below line after &lt;version&gt; tag of your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/441/1*3s6axjv4XBRo_iD4U1lYrA.png" /></figure><p>Add the following tags in a new line inside project tag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*YdnrZTeGz96MLYlKo4TNGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LjRUj_1D-H9w7WA0Jx-7hQ.png" /></figure><p>After updating Pom.xml the next thing to do is we need to have user defined Special class called Listener Class because as soon as some Test Case gets failed, we need to listen to that event then we need to capture the screenshot and screenshot should be part of the report, to do this we need to create a Listener class</p><p>This Listener class implements <em>ITestListener </em>interface</p><p>Here we write code to take screenshot and also we need to add @Attachment annotation from allure. If you extend your class with <em>ITestListener </em>interface, you will able to generate these methods automatically if you right-click on class name and choose implement methods. You can then write your code according to what you need to do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HJJtHNznLUCDHm8dxbamBg.png" /></figure><p>In the above code , I have used @Attachment annotation to denote that method will generate a screenshot which would be saved as an attachment to the allure report. In the method <em>onTestFailure </em>, I am fetching the driver from the base class to be the current driver and then I am getting the method which has failed and then taking screenshot. Also I am having a <em>saveTextLog </em>method to write a log about the screenshot taken. We will also save this <em>saveTextLog message </em>as an attachment to the allure report.</p><p>Now we need to add <em>@Listeners({TestExecutionListener.class})</em> Annotation to a Test class</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*42A_uSjmMwWmZAqj1B7Z-w.png" /></figure><p>Now run the TestSuite again</p><p>Run the following command in command prompt</p><p><strong><em>allure serve &lt;folder-path&gt;</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdhS11bzVAuF3_vS_71-LA.png" /></figure><p>We can see the screenshot has been successfully captured and also the Log Message is also displayed as a attachment below the image under the Suites section.</p><p>That&#39;s all for now. Happy reporting!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=18d6d24e997d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web scrapping dynamic content with API and Beautiful Soup]]></title>
            <link>https://medium.com/@sukanya.ravinder/web-scrapping-dynamic-content-with-api-and-beautiful-soup-d64e5139d4bd?source=rss-6b5c2217950b------2</link>
            <guid isPermaLink="false">https://medium.com/p/d64e5139d4bd</guid>
            <category><![CDATA[beautifulsoup]]></category>
            <category><![CDATA[web-scrapping]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Sukanya Ravinder]]></dc:creator>
            <pubDate>Fri, 17 Sep 2021 17:26:09 GMT</pubDate>
            <atom:updated>2021-09-17T17:26:09.770Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Note</strong>: <em>This method is applicable only if the API can be accessed to fetch records as many websites may have secure APIs . In that case you can go for other tools like Selenium </em>or <em>Scrapy.</em></blockquote><p>I have worked in scrapping projects but this one was very challenging for me due to few reasons. First reason being that I was scrapping with Beautiful Soup for the first time and Python is new to me. I have used Selenium before with Python to scrap but this time I decided to use Beautiful Soup.</p><h4><strong>So what is Beautiful Soup?</strong></h4><p>According to the web, Beautiful Soup is a Python library that is used for <strong>web scraping purposes to pull the data out of HTML and XML files</strong>. It creates a parse tree from page source code that can be used to extract data in a hierarchical and more readable manner. This python library is called <strong>bs4 </strong>and you just need to use with import statement in beginning of your python code</p><p><strong><em>import bs4 </em></strong>and you are set to use <strong>Beautiful Soup</strong>!</p><p>I was trying to scrap some data out of a website . I started with Selenium for the basic actions of dropdowns and clicks but I used <strong><em>BeautifulSoup</em></strong> to parse the elements and store data and used that to populate the values into dropdowns. It was so good to see how fast the dropdown options were getting selected! As long as you can see values on the page source inside the HTML body you are good to use <strong><em>BeautifulSoup</em></strong>.</p><h4><strong><em>But what if you cant see the values??</em></strong></h4><p>Imagine a search option shows a table of data but when you right click on the page and click Page Source , you don&#39;t see the table. Then how do you use <strong><em>BeautifulSoup </em></strong>for the same? It is ideally not possible because BeautifulSoup is just an HTML parser. So in those scenarios it is better to use <strong><em>Selenium </em></strong>to pull dynamic content. <strong><em>Yes if we cant see tables in the HTML body then those are dynamically generated through scripts.</em></strong></p><p>I determined to find out other ways to pull data without using Selenium. Since this was data related website , one possible approach would be to find out the API of the website and directly pull out the data. If that&#39;s possible you can still use <strong><em>BeautifulSoup </em></strong>because the data rendered would have an html body and all you need to is to parse it .</p><p>So how to find out if the website has a API that can be accessed. Following are the steps:</p><ol><li>Open the website you intend to scrap and in your browser click on the three vertical dots on the right upper corner, go to <strong><em>MoreTools</em></strong>-&gt; <strong><em>DeveloperTools</em></strong></li></ol><p>2. A window will open on the side as below. By default it goes to Network tab. Click on the <strong><em>Fetch/XHR</em></strong> beside the <strong><em>All </em></strong>option and do <strong><em>Ctrl+R</em></strong> as instructed below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*iA5vZfVdRQjlLaozRDH9SA.png" /></figure><p>3. The dialog will start recording the network events. All this while your website is open on the side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/767/1*qMWyKBTKMUFhRgdf66mRBA.png" /></figure><p>4. Now lets perform some actions on the website like selecting from dropdown and clicking on Search buttons.</p><p>I have selected some values from dropdowns and clicked on Search button . I see a table below for the data. But as soon I click the Search button I also see a method<strong><em> </em></strong>displayed on the side window.</p><p>If you click on that method, you will get information about the request and response headers. If you scroll down you can also view the form-data. You can preview the data returned and also check the response. If the status code is 200, then we can be sure that data has been fetched. But if the API is secured and requires authentication, then it is better to go with <strong><em>Selenium </em></strong>or <strong><em>Scrapy</em></strong> for scrapping dynamic content.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*D4NSnzqB-6r2gDWhmJMmCw.png" /></figure><p>Now go to your code. In your code where the Search button click logic is written, below that write the code to fetch data from the <strong><em>Request URL </em></strong>using<strong><em> </em></strong>the <strong><em>Form Data</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*EUMicriPStavlY_JE4p6IQ.png" /></figure><p>You can get the values of the currently selected dropdowns from the content of the BeautifulSoup. Store these values and we will be passing those into the request URL to fetch data. For example if I want to see table data for particular fields, then I store those fields values into variables and will pass them as form data fields. Here <strong><em>rID </em></strong>and <strong><em>sID </em></strong>stores values which we will pass as a JSON input. That is stored in the <strong><em>payload </em></strong>variable.</p><p>For the request , I have imported <strong>urllib3 </strong>package and used <strong><em>request </em></strong>function. In this function you will pass the action which is <strong><em>POST </em></strong>along with the <strong><em>URL </em></strong>and the form fields.</p><p>The result of the request if successful is going to fetch the data depending on the form fields sent . That entire response data can be stored as a BeautifulSoup which is what I have done in the second last line in the code above. I am parsing the content as a xml. You can also use <strong><em>html.parser</em></strong> or <strong><em>html5lib</em></strong></p><p>Then once you have saved it as a BeautifulSoup content, you can simple parse the entire data and fetch the records within a matter of seconds. In this website since the data is in the form of tables, we parse the entire content with <strong><em>tr </em></strong>and <strong><em>td </em></strong>tags and fetch data, store them as a dictionary. I was able to fetch almost 700+ records in a matter of less than 2 mins for all dropdown values.</p><h4>Conclusion</h4><p>Just to summarize , I have used BeautifulSoup to parse the contents of the page and used the API to fetch the data and parse the data to create a dictionary for the same. Below I am pasting a comparison of the tools that can be used for scrapping with Python. Each of the tools presented has its advantages and disadvantages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*80UYdtOIBYAmVSC4xTrSHg.png" /></figure><p>In a nutshell, go with <strong>BeautifulSoup</strong> if you want to speed up development or if you just want to familiarize yourself with Python and web scraping. With <strong>Scrapy</strong>, demanding web scraping applications can be implemented in Python — provided you have the appropriate know-how. Use <strong>Selenium</strong> if your primary goal is to scrape dynamic content with Python.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d64e5139d4bd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Entity Relationship Diagrams]]></title>
            <link>https://medium.com/@sukanya.ravinder/understanding-entity-relationship-diagram-1047b9cc5394?source=rss-6b5c2217950b------2</link>
            <guid isPermaLink="false">https://medium.com/p/1047b9cc5394</guid>
            <category><![CDATA[erd]]></category>
            <category><![CDATA[dbms]]></category>
            <category><![CDATA[database-design]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sukanya Ravinder]]></dc:creator>
            <pubDate>Wed, 25 Aug 2021 15:01:51 GMT</pubDate>
            <atom:updated>2021-08-25T15:04:20.004Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>ER Diagram</strong> stands for Entity Relationship Diagram, also known as ERD is a diagram that displays the relationship of entities stored in a database. In other words, ER diagrams help to explain the logical structure of databases. ER diagrams are created based on three basic concepts: entities, attributes and relationships.</p><h3>What is the use of ER Diagrams?</h3><p>Although they can be used to model almost any system they are primarily used in the following areas.</p><h4>ER Models in Database Design</h4><p>They are widely used to design relational databases. The entities in the ER schema become tables, attributes and converted the database schema. Since they can be used to visualize database tables and their relationships it’s commonly used for database troubleshooting as well.</p><h4>Entity relationship diagrams in software engineering</h4><p>Entity relationship diagrams are used in software engineering during the planning stages of the software project. They help to identify different system elements and their relationships with each other. It is often used as the basis for data flow diagrams as they are commonly known.</p><p>For example, an inventory software used in a retail shop will have a database that monitors elements such as purchases, item, item type, item source and item price. Rendering this information through an ER diagram would be something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/0*4iRRNQQ0zXXqSJwG.jpeg" /></figure><p>In the diagram, the information inside the oval shapes are attributes of a entity <em>item</em>.</p><h3>Entity Relationship Diagram (ERD) Symbols and Notations</h3><p>There are three basic elements in an ER Diagram: entity, attribute, relationship. There are more elements which are based on the main elements. They are weak entity, multi valued attribute, derived attribute, weak relationship, and recursive relationship. Cardinality and ordinality are two other notations used in ER diagrams to further define relationships.</p><h4>Entity</h4><p>An entity can be a person, place, event, or object that is relevant to a given system. For example, a school system may include students, teachers, major courses, subjects, fees, and other items. Entities are represented in ER diagrams by a rectangle and named using singular nouns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/0*eq-qBJT8ZppEiZrg.png" /></figure><h4>Attribute</h4><p>An attribute is a property or characteristic of an entity, relationship, or another attribute. In the below example, Name is an attribute of the entity Student. An entity can have as many attributes as necessary. Meanwhile, attributes can also have their own specific attributes. For example, the attribute “student address” can have the attributes number, street, city, and state. These are called composite attributes. Attributes are represented by oval shapes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/411/0*L9z1VUwUkHU0GUnj.png" /></figure><h4>Relationship</h4><p>Relationships are represented by diamond-shaped box. Name of the relationship is written inside the diamond-box. All the entities (rectangles) participating in a relationship, are connected to it by a line.</p><ul><li><strong>One-to-one</strong> − When only one instance of an entity is associated with the relationship, it is marked as ‘1:1’. The following image reflects that only one instance of each entity should be associated with the relationship. It depicts one-to-one relationship.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*4Y61QY6pJS_rK5xM.png" /></figure><ul><li><strong>One-to-many</strong> − When more than one instance of an entity is associated with a relationship, it is marked as ‘1:N’. The following image reflects that only one instance of entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts one-to-many relationship.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*08o1m_q89CW9tk6_.png" /></figure><ul><li><strong>Many-to-one</strong> − When more than one instance of entity is associated with the relationship, it is marked as ‘N:1’. The following image reflects that more than one instance of an entity on the left and only one instance of an entity on the right can be associated with the relationship. It depicts many-to-one relationship.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*xFmZW_N_BLcoZFDq.png" /></figure><ul><li><strong>Many-to-many</strong> − The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to-many relationship.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/553/0*FZbvZ2vjgRN_JLM2.png" /></figure><h4>Recursive Relationship</h4><p>If the same entity participates more than once in a relationship it is known as a recursive relationship. In the below example an employee can be a supervisor and be supervised, so there is a recursive relationship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/242/0*UC-oVlRbGgfXEUXj.jpeg" /></figure><p>There are many other concepts involved in the creation of ER diagram, but in this blog we will stick with the basic ones.</p><h3>How to Draw ER Diagrams</h3><p>Below points show how to go about creating an ER diagram.</p><ol><li><strong>Identify all the entities</strong> in the system. An entity should appear only once in a particular diagram. Create rectangles for all entities and name them properly.</li><li><strong>Identify relationships</strong> between entities. Connect them using a line and add a text or a diamond in the middle describing the relationship.</li><li><strong>Add attributes</strong> for entities. Give meaningful attribute names so they can be understood easily.</li></ol><p>In a complex system, it can be a nightmare to identify relationships. With more practice we can build more complex and meaningful diagrams.</p><h4>ER Diagram Best Practices</h4><ul><li>Provide a clear and appropriate name for each entity, attribute, and relationship in the diagram. Terms that are simple and familiar are always preferred. Meanwhile attribute names must be meaningful, unique, and easily understandable.</li><li>Remove redundant or unnecessary relationships between entities.</li><li>Never connect a relationship to another relationship.</li><li>Make effective use of colors. You can use colors to classify similar entities or to highlight key areas in your diagrams.</li></ul><h3>Benefits of ER diagrams</h3><p>ER diagrams constitute a very useful framework for creating and manipulating databases. First, ER diagrams are easy to understand and do not require a person to undergo extensive training to be able to work with it efficiently and accurately. This means anyone can learn how to do ER diagrams and use them to effectively communicate to the developers, customers or end users regardless of their IT background.</p><p>Second, ER diagrams are readily convertible into relational tables which can be used to quickly build databases. In addition, ER diagrams can directly be used by database developers as the blueprint for implementing data in specific software applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1047b9cc5394" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID Principles of OOP: Single Responsibility Principle]]></title>
            <link>https://medium.com/@sukanya.ravinder/solid-principles-of-oop-single-responsibility-principle-dae39c958bff?source=rss-6b5c2217950b------2</link>
            <guid isPermaLink="false">https://medium.com/p/dae39c958bff</guid>
            <category><![CDATA[oop]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Sukanya Ravinder]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 18:07:12 GMT</pubDate>
            <atom:updated>2021-08-24T18:07:12.315Z</atom:updated>
            <content:encoded><![CDATA[<p>The SOLID principles form the most important principles of OOPS programming. They are practices used to best design a class structure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*1NdoRRB0OWZJ2SLI.jpg" /></figure><p>These five principles help us understand the need for certain design patterns and software architecture in general. So it is a topic that every developer should learn.</p><p>Regardless of whether it is clean code, object oriented programming, they all serve the same purpose: <em>“To create understandable, readable, and testable code that many developers can collaboratively work on.”</em></p><p>The SOLID principles acronym is as below.</p><ul><li>The <strong>S</strong>ingle Responsibility Principle</li><li>The <strong>O</strong>pen-Closed Principle</li><li>The <strong>L</strong>iskov Substitution Principle</li><li>The <strong>I</strong>nterface Segregation Principle</li><li>The <strong>D</strong>ependency Inversion Principle</li></ul><p>We will look into the <strong>S</strong>ingle <strong>R</strong>esponsibility principle in this blog.</p><h3>The Single Responsibility Principle</h3><p>This principle states that <strong>a class should only have one responsibility. Furthermore, it should only have one reason to change.</strong></p><p>Let’s see a few of its benefits:</p><ol><li><strong>Testing</strong> — A class with one responsibility will have far fewer test cases.</li><li><strong>Lower coupling</strong> — Less functionality in a single class will have fewer dependencies.</li><li><strong>Organization</strong> — Smaller, well-organized classes are easier to search than monolithic ones.</li></ol><p>For example lets look at a class to represent a simple Meal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*hkWQTqgLlrQEr_p2WV5_6A.jpeg" /></figure><p>In this code we store the name, description and price associated with an instance of a <em>Meal</em>.</p><p>Now lets add a couple of methods to query a meal name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*rhgPOqpPLCouPoaNfsxcIQ.png" /></figure><p>Now our <em>Meal</em> class works well, and we can store as many meals as we like in our application. But what’s the use of storing the information if we can’t output the name to our console and read it?</p><p>Let’s add a print method:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*j26eEHYxyIYvN6xqHRXynQ.png" /></figure><p>However, this code violates the single responsibility principle we outlined earlier.</p><p>To fix this, we should implement a separate class that deals only with printing out meal names:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*66UQ0qo_d-LKMAyfjnUUfA.png" /></figure><p>Awesome. Not only have we developed a class that relieves the <em>Meal </em>of its printing duties, but we can also leverage our <em>MealPrinter </em>class to send our text to other media.</p><p>Whether it’s email, logging, or anything else, we have a separate class dedicated to this one concern.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dae39c958bff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID Principles of OOP: Open-Closed Principle]]></title>
            <link>https://medium.com/@sukanya.ravinder/solid-principles-of-oop-open-closed-principle-b89bba42ef44?source=rss-6b5c2217950b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b89bba42ef44</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[solid]]></category>
            <category><![CDATA[oop]]></category>
            <dc:creator><![CDATA[Sukanya Ravinder]]></dc:creator>
            <pubDate>Tue, 24 Aug 2021 18:07:12 GMT</pubDate>
            <atom:updated>2021-08-26T17:47:45.417Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we’ll discuss the <strong>Open/Close Principle (OCP) </strong>as one of the <strong>SOLID</strong> principles of object-oriented programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*F3NYkoyRa9zFrn76.jpg" /></figure><p>As the name suggests<strong>, this principle states that software entities should be open for extension, but closed for modification.</strong> As a result, when the business requirements change then the entity can be extended, but not modified.</p><p>For the illustration below, we’ll focus on how interfaces are one way to follow this principle<strong>.</strong></p><p>For example Let’s consider we’re building a calculator app that might have several operations, such as addition and subtraction. First we will define a interface <em>CalculatorOperation</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/359/1*QSPzdO6MMsZcL5L6ne3-Lg.png" /></figure><p>Let’s define an <em>Addition</em> class, which would add two numbers and implement the C<em>alculatorOperation</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*fss0rpd7_Uxa9JXRAGB-EA.png" /></figure><p>We define another class named <em>Subtraction</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*b0YjiDMgcroLRT2Ede5AOg.png" /></figure><p>Let’s now define the main class, which will perform the calculator operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*oyZTAOsz0eMuHuDdO4RRWA.png" /></figure><p>Although the above codes seem fine, this is not a good example of OCP. Because if we add additional classes for multiply and divide , we have no option other than changing the calculate method of the <em>Calculator </em>class.</p><p><strong>Hence, we can say this code is not OCP compliant. </strong>The code in the <em>calculate</em> method will change with every incoming new operation request. So, we need to extract this code and put it in an abstraction layer.</p><p>One solution is to delegate each operation into their respective class: We create an abstract class <em>Perform </em>inside the interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*8rJcKdpcVjSSHH8_Igdw_A.png" /></figure><p><strong>As a result, the <em>Addition</em> class could implement the logic of adding two numbers by using </strong><em>@Override</em> annotation<strong>:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*fynWzbOSzEJ4XABXBPsf1w.png" /></figure><p>Likewise, an updated <em>Subtraction</em> class would have similar logic. And similarly to <em>Addition</em> and <em>Subtraction</em>, we could implement the <em>division</em> logic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*euUwVn-IfGg5qDq_hwaFNQ.png" /></figure><p>And finally, our <em>Calculator</em> class doesn’t need to implement new logic as we introduce new operators:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*wDVK-0FtYmc6xNiwEDUUDw.png" /></figure><p>That way the class is <em>closed </em>for modification but <em>open </em>for an extension.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b89bba42ef44" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>