<?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 Swati Pandharkar  on Medium]]></title>
        <description><![CDATA[Stories by Swati Pandharkar  on Medium]]></description>
        <link>https://medium.com/@swatij81?source=rss-661e77a227ad------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*joPdjcHMe-zKH_DU</url>
            <title>Stories by Swati Pandharkar  on Medium</title>
            <link>https://medium.com/@swatij81?source=rss-661e77a227ad------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 21:46:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@swatij81/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[Run JMeter and generate HTML Dashboard Report from command line (non GUI mode)]]></title>
            <link>https://medium.com/@swatij81/run-jmeter-and-generate-html-dashboard-report-from-command-line-non-gui-mode-ecf6c5f4949?source=rss-661e77a227ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecf6c5f4949</guid>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[load-testing]]></category>
            <dc:creator><![CDATA[Swati Pandharkar ]]></dc:creator>
            <pubDate>Wed, 13 Jul 2022 21:32:30 GMT</pubDate>
            <atom:updated>2022-07-13T21:46:52.282Z</atom:updated>
            <content:encoded><![CDATA[<p>The <strong>Apache JMeter</strong> is open-source software, a 100% pure Java application designed for performance testing.</p><p>The GUI mode of JMeter is perfect for adding and editing new configuration elements, thread groups, and samplers. However, the GUI mode consumes a lot of memory and resources while running the recorded script. GUI mode is not recommended for heavy load testing.</p><p>Once your Test Plan is ready, use CLI mode (Command-line mode previously called Non-GUI mode) to run it for the Load Test. Using CLI mode, you can generate a CSV file containing results and have JMeter generate an HTML report at end of load test. By executing script at command line it can be easily integrated with other systems (Jenkins/Other CI tools).</p><p>In this blog, we will see how to run JMeter test from command line and generate an HTML report.</p><p><strong>Prerequisite</strong>:</p><p>Apache JMeter installed on your system.</p><p>A test plan built and available in JMeter.</p><p>You can follow my previous blog to install JMeter, start JMeter in GUI mode and build a test plan.</p><p><a href="https://medium.com/@swatij81/rest-api-load-testing-using-jmeter-8f494539b85a">Rest API Load Testing Using JMeter</a></p><h3><strong>Steps to run JMeter in command line mode</strong>:</h3><ol><li>Open command prompt.</li><li>Go into JMeter’s bin folder</li><li>Enter the following Command to run JMeter test</li></ol><pre>jmeter -n -t &lt;location of jmeter script&gt; -l &lt;location of result file&gt;</pre><ul><li>-n specifies the JMeter is to run in cli mode.</li><li>-t specifies name of JMX file that contains the Test Plan.</li><li>-l specifies name of result file to log sample results to. The result file must not exist or be empty.</li></ul><p>Screenshot of JMeter test plan, which we will run from command line:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xIMGasZfoaDtBGhCpovQHg.png" /><figcaption>JMeter Test Plan</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*r_UsWwI4--EhQ0FL4az6FQ.png" /><figcaption>Run JMeter test from command line</figcaption></figure><p>Go to the specified location of result file and see if the csv file (in this case, file CSVTest1.csv) is created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*ZLoicvwXgt9m83vfnOEIlg.png" /></figure><p>Now open the CSV file to check whether the results are logged into it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*DmdcVhCsOIk8q9hDTOoeVg.png" /><figcaption>CSVTest1.csv file</figcaption></figure><h3>Generating Report Dashboard:</h3><p>JMeter supports dashboard report generation to get graphs and statistics from a test plan. The dashboard generator reads and processes samples from CSV files to generate HTML files containing graph views. It can generate the report at end of a load test or on demand.<br>Lets see how to use the dashboard generator.</p><p><strong>Option 1:</strong> You can create a dashboard report at the end of test case execution.</p><p>Command to run JMeter script and generate a dashboard report is as follows:</p><pre>jmeter -n -t &lt;location of jmeter script&gt; -l &lt;location of result file&gt; -e -o &lt;location of output folder&gt;</pre><ul><li>-e specifies generate report dashboard after load test</li><li>-o specifies output folder where to generate the report dashboard after load test. Folder must not exist or be empty.</li></ul><p>Screenshot of JMeter test plan, which we will run from command line and generate report.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5EiaUxcX5ypLs4z6GibcQg.png" /><figcaption>JMeter Test Plan</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*UJKTrMcgGsI2M1EpZxALYA.png" /><figcaption>Command to run JMeter test and generate HTML report</figcaption></figure><p>Go to the specified location and check whether the CSV test result file (CSVTestResult.csv) and output folder (Dashboard) are created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*jaAqQndxBqtEL1Q_zJJ0sg.png" /><figcaption>“CSVTestResult.csv” file and output folder “Dashboard” created at specified location</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*R2Gn9X0eTpS3zwA4LZOUyQ.png" /><figcaption>CSVTestResult.csv file</figcaption></figure><p>To view the dashboard report, go to Dashboard folder and open index.html file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*yVsHymiBvbZSUlinCw2lSQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FTaxXGScUfMKjX1bhfvzaA.png" /><figcaption>HTML Dashboard Report</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FCvLTWrHmkmVDGS2t-fviQ.png" /><figcaption>Chart of type “Over Time”</figcaption></figure><p>This report provides different metrics e.g. APDEX table, request summary graph showing the Success and failed requests percentage, different charts etc. Toleration threshold and Frustration threshold values are configurable.</p><p><strong>Configuring Dashboard Generation:</strong></p><p>Dashboard generation uses JMeter properties to customize the report. All report generator properties can be found in file <strong>reportgenerator.properties</strong>. To customize these properties, you should copy them in <strong>user.properties</strong> file and modify them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*OlNO-x6kGmag_W1hGkhhDQ.png" /><figcaption>reportgenerator.properties file inside JMeter/bin folder</figcaption></figure><p>Go to JMeter/bin folder, you will find user.properties file. Open that file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*XxTlDJx1F_4YBQNn3M8QKQ.png" /><figcaption>user.properties file inside JMeter/bin folder</figcaption></figure><p>If needed, you can change the tolerated and satisfied threshold values in<strong> user.properties</strong> file. Then run your JMeter at command line and generate a dashboard report. Now those updated threshold values will be reflected in the dashboard.</p><p><strong>Option 2:</strong> Create a dashboard report from a standalone CSV file.</p><p>Suppose, you have already executed JMeter test from command line and generated CSV result. You can create a dashboard from CSV file using below command.</p><pre>jmeter -g &lt;location of csv file&gt; -o &lt;location of output folder&gt;</pre><p>We will use the csv file generated on run of JMeter in command line mode at the beginning of this blog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*8STqbG5feonaByyhRn2CAw.png" /><figcaption>Run command to generate dashboard from CSV result file</figcaption></figure><p><strong>Note:</strong> My CSV file and output folder are at the same location (JMeter/bin), so I have just specified their names.</p><p>Go to the specified location and check if output folder is created. Go inside the output folder (Report)and you can see HTML report file i.e. index.html file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*pxzG-VfkpbqLX1dRlTqpGw.png" /><figcaption>index.html inside Report folder</figcaption></figure><p>Screenshot of HTML report:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VPduSQTajUV_sBYnmpRg7w.png" /></figure><p><strong>Conclusion:</strong></p><p>GUI mode of JMeter is not recommended for heavy load testing. GUI mode should only be used for creating the test script, CLI mode (NON GUI) must be used for load testing.</p><p>Following points covered in this blog:</p><ul><li>Steps to Run JMeter in command line mode</li><li>Generating report dashboard: generate the report at end of a load test or on demand.</li></ul><p><strong>References</strong>: <a href="https://jmeter.apache.org/usermanual/">https://jmeter.apache.org/usermanual/</a></p><p><strong>Happy Load Testing</strong> !!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecf6c5f4949" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rest API Load Testing Using JMeter]]></title>
            <link>https://medium.com/@swatij81/rest-api-load-testing-using-jmeter-8f494539b85a?source=rss-661e77a227ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f494539b85a</guid>
            <category><![CDATA[jmeter]]></category>
            <category><![CDATA[api-testing]]></category>
            <dc:creator><![CDATA[Swati Pandharkar ]]></dc:creator>
            <pubDate>Sun, 26 Jun 2022 21:34:05 GMT</pubDate>
            <atom:updated>2022-07-09T02:48:43.359Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/521/0*MrTlCKPxpWWes2QY.png" /><figcaption>Image from jmeter.apache.org</figcaption></figure><p>In this article, we will learn how to do basic load testing of Rest API using Apache JMeter. The Apache JMeter is an open-source tool based on Java used to perform load testing and performance testing. As JMeter is solely Java-based, it can be used on any platform that has a JVM - Windows, Linux, or macOS.</p><p><strong>What is load testing?</strong></p><p><strong>Load testing</strong> is a type of performance testing that simulates a real-world load on any application. The goal of Load Testing is to improve performance and to ensure stability.</p><p><strong>What is an API?</strong></p><p><strong>API or Application Programming Interface</strong> is an intermediate software that makes the interaction between two applications possible. API acts as a messenger between two systems.</p><p>JMeter simulates a group of users sending requests to a server, and returns result that show the performance of the target application via tables, graphs, logs etc.</p><h3><strong>Demo of JMeter API testing</strong></h3><p>In the below sections, we will see how to install JMeter and perform API testing in JMeter.</p><p><strong>Install Apache JMeter</strong>:</p><p>There is just one prerequisite for downloading and installing JMeter-to have Java installed in your system. JMeter is compatible with <strong>Java 8 or higher.</strong></p><ol><li>Check if Java is installed</li></ol><p>Open the command prompt and put the command java -version</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*xuwFve9fmo9EzV5X6Wqapg.png" /></figure><p>If you have Java installed in your system, the command will show the version of Java installed. Else, you must install Java before going forward with the installation of JMeter.</p><p>2. Download JMeter</p><ul><li>To download JMeter go to the Apache JMeter website</li></ul><p><a href="https://jmeter.apache.org/download_jmeter.cgi">https://jmeter.apache.org/download_jmeter.cgi</a></p><p>On the website go to the binaries section and download the zip file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*pSRnZF9HRnUBtdN5epKq4g.png" /></figure><p>3. Install JMeter</p><ul><li>Once the zip folder is downloaded, go to the folder location, and then extract the zip folder.</li><li>Once the folder is extracted go inside that folder and then go inside the bin folder.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*guWDHmlpyhVWuOBZhqfdpQ.png" /></figure><p>4. Launch JMeter</p><p>You can start JMeter in three modes:</p><ul><li>GUI Mode</li><li>Server Mode</li><li>Command Line Mode</li></ul><p><strong>Start JMeter in GUI mode:</strong></p><p>In the bin folder open the jmeter.bat file. It will take a while to open.</p><p>Note: GUI mode is not good for heavy load testing, since it consumes a lot of memory and resources. GUI mode of JMeter is designed for test recording, development and debugging purpose.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*9nonbCVtEXPsOqSbDQet3Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*haIK0MbxzTY3jWt5ZN54Pw.png" /></figure><p>This is how you can download and install JMeter onto your system.</p><p><strong>Steps to JMeter API load testing</strong></p><ol><li><strong>Add a Thread Group</strong></li></ol><ul><li>Start <strong>JMeter</strong> and select the <strong>Test Plan</strong>. Test Plan is where you can add elements required for your JMeter Test script.</li><li>Right click on the <strong>Test Plan</strong> and select <strong>Add -&gt;Threads (Users)</strong> -&gt; <strong>Thread Group</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*T8O6WJUiRZ4MAV03vTNV-A.png" /></figure><p>Once you click on Thread Group, there are three things under Thread Properties that are important concerning the load test:</p><ul><li>The number of threads (users): It reflects the number of threads or users JMeter will simulate. e.g. 150</li><li>Ramp-Up Period (in seconds): The duration of time that JMeter will take before starting the thread over. e.g. 10</li><li>Loop Count: It is the number of times the test will be executed. Let’s leave it to be 1, so JMeter will run your test only one.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*VoolUL3AfmaGxZFZtfli5A.png" /></figure><p>2. <strong>Add an HTTP Request Sampler</strong></p><p>Add an HTTP Request Sampler inside a Thread group (<strong>Test Plan -&gt; Thread</strong> <strong>Group -&gt; Add -&gt; Sampler-&gt; HTTP Request</strong>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*48HutLMPTfIYLjAFtBposQ.png" /></figure><p>3. Next search for <strong>REST APIs</strong> that are freely available on the internet. We will take the example of Reqres API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*yVGsZ7h2pGocF0BJTWnVDg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*pkLqFqvF9XTioA-YadON9A.png" /></figure><p>4. Now you have the <strong>API</strong>, find out the server name, path, and parameters from the link. Copy those values in the <strong>HTTP Request</strong> of JMeter Test Plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*435MOy1Pp-JPXbwcSVCfVQ.png" /></figure><p>5. To view the results of your Test, add a Listener. Right click on <strong>HTTP Request</strong>, select <strong>Add -&gt;</strong> <strong>Listeners</strong> -&gt; <strong>View Results Tree.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*Jf3siO2hPJzhdKLFw8brrA.png" /></figure><p>6. Save the test (.jmx)and run it. Simply click on the green button or short key <strong>Ctrl+R</strong> to run the test.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*uSEWfI3cc6Gh6Wxx8D8lWg.png" /></figure><p><strong>Test Result</strong> above shows the <strong>Request</strong> and <strong>Response</strong> for the HTTP Request server.</p><p>7. You can increase the number of <strong>Threads</strong> in order to increase the <strong>Load</strong> on your API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*YUt_psTww-U5Blpbs7McLg.png" /></figure><p>8. Now run your test again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/1*EmUpXxhtWccd3QtrMoj61Q.png" /></figure><p>Similarly we can test any API to see how its endpoints behave with the various loads. We can identify issues on some endpoints when processing heavy loads.</p><p><strong>How to view JMeter results?</strong></p><p>Results of the tests executed in JMeter can be viewed using Listeners. JMeter listeners allow viewing the results in various formats like Table, Trees, Graphs, Logs, etc.</p><p>For our demo, we have added <strong>View Results Tree</strong> listener. The response can be viewed in different formats that can be selected from the drop-down on the left as shown in the below screenshot. We can see that the status of all the requests is Success as indicated by a green shield with a tick in it.</p><p>The Sampler result tab contains the<strong> response code, response message and information about time, latency, response size in bytes</strong> — separately for the headers, the body and the error count.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*36x_XyCFwhCm1xVJPPp52g.png" /></figure><p>In this demo we did a fairly simple Rest API load test. You can play around with JMeter and read more in the documentation in order to build more powerful load tests.</p><p>Cheers!!</p><p><strong>Happy Testing !</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f494539b85a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to take screenshots for failed tests using TestNG ?]]></title>
            <link>https://medium.com/@swatij81/how-to-take-screenshots-for-failed-tests-using-testng-1655e98f281e?source=rss-661e77a227ad------2</link>
            <guid isPermaLink="false">https://medium.com/p/1655e98f281e</guid>
            <dc:creator><![CDATA[Swati Pandharkar ]]></dc:creator>
            <pubDate>Wed, 04 May 2022 03:17:48 GMT</pubDate>
            <atom:updated>2022-05-04T03:17:48.095Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to take screenshots for failed tests using TestNG ?</h3><p>Automated testing is a significant part of the entire software testing life cycle. The ability to execute scripts without interfering has resulted in higher efficiency. If something goes wrong and test script fails, some visual representation of exact anomaly helps tester to identify the issue. This is where Selenium screenshots come into play.</p><p>Automation test script may fail due to various problems:</p><p>· Application issue</p><p>· Assertion failure</p><p>· Not able to find web elements on a page</p><p>· Timeout while finding web elements on a page</p><p>To capture screenshot of the test cases that has been failed, TestNG provides Listeners, an interface that modifies TestNG behavior. Listeners are implemented by ITestListener interface. As the name suggests, Listeners “listen” to the events defined in Selenium script and behave accordingly. When the test case fails, it is redirected to the new block written for screenshot.</p><p><strong>Here are steps to capture screenshot in Selenium using TestNG Listener:</strong></p><p><strong>· </strong>Create a class. Implement <strong>TestNG ‘ITestListener’.</strong></p><p><strong>· Call </strong>the method ‘<strong>onTestFailure’.</strong></p><p>· <strong>Add t</strong>he code to take a screenshot with this method.</p><p><strong>Sample code to capture screenshot of failed test case is shown below:</strong></p><p><strong>Pre-requisite</strong>: Create a maven project and add following dependencies to pom.xml.</p><p>Selenium-java</p><p>TestNG</p><p>Webdriver Manager</p><p><strong>Step 1</strong> — Create a base class to define a webdriver instance and a method to take the screenshot.</p><p>By using <strong><em>TakesScreenshot </em></strong>and <strong><em>getScreenshotAs </em></strong>methods, we can take screenshot.</p><pre>File srcFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);</pre><p><strong><em>(TakesScreenshot)driver </em></strong>(As we can’t create object directly, so typecast it) and then get screenshot as file and assign it to the File variable.</p><pre>FileUtils.copyFile(srcFile, new File(&quot;./Screenshots/&quot;+ testMethodName + &quot;_&quot; + TimeStamp + &quot;.png&quot;));</pre><p>Instead of just taking a screenshot, we will get the test method name, timestamp and screenshot and store it into a destination folder.</p><p>To get the timestamp, we will use a class in java called as Date. Let’s create an object of this class.</p><pre>Date d = new Date();</pre><p>It will return current system date along with time, but here we have to replace ”:” and “ ” because they are not supported in the file name. So will replace ”:” and “ ” and convert this timestamp to String.</p><pre>String TimeStamp = d.toString().replace(&quot;:&quot;, &quot;_&quot;).replace(&quot; &quot;, &quot;_&quot;);</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*tzbiU_vaKojZk-1MzbDhzg.png" /></figure><p><strong>Step 2</strong> — Create a TestNG Listener and call “onTestFailure” method.</p><p>Code snippet to create a class “TestStatusListener” and implement ITestListener:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*UGwZQKbCPRi_eamBxXLg4Q.png" /></figure><p>In the above code, ITestResult is an interface which keeps all information about test case like test case name, test case execution status. When a test script fails, it calls a method onTestFailure (method FailedScreenshot() from a Base class) to take screenshot.</p><p><strong>Step 3</strong> — Create another class “Testcases”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*rKJq0a3Bt1lq7AyG7QiWJg.png" /></figure><p><strong>Step 4</strong> — Implement TestNG Listener in our regular project class i.e. “Testcases”.</p><p>There are two different ways to connect class and interface.</p><p>The first way is to use Listener annotation (<strong>@Listeners</strong>) as shown below:</p><p>@Listeners (ListenerDemo.TestStatusListener.class)</p><p>We will use this in the class “Testcases” as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*BohL4n-qwvHuaS6c5XosXw.png" /></figure><p><strong>Step 5</strong> — Execute the “Testcases” class. onTestFailure method in class “TestStatusListener” is called automatically when any method annotated as @Test fails.</p><p>Output of the project class “Testcases” on console looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*XIG0Ao0_g4NIWBZthSfykg.png" /></figure><p>“ScreenshotTest2” failed on asserting title of the webpage. Screenshot is captured for this method under “Screenshots” folder. Screenshot file name contains failed method name and timestamp.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*khwxR9Vp_6ybFcR4v3_APw.png" /></figure><p><strong>Step 6</strong> — Use of Listener for multiple classes</p><p>If project has multiple classes, instead of adding Listeners to each class, create a testng.xml and add listeners tag in xml.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/764/1*rAxX2Ro6JOd3_NOhZSk7jw.png" /></figure><p>This listener is implemented throughout the test suite irrespective of the number of classes you have. When you run this XML file, listeners will work on all classes mentioned in testng.xml.</p><p><strong>Summary:</strong></p><ul><li>Listeners are interfaces used in selenium web driver script.</li><li>Demonstrated the use of ITestListener with onTestFailure method to take screenshots of <strong>only</strong> failed test cases.</li><li>Implemented the Listeners for single class with <strong>@Listeners</strong> annotation</li><li>Implemented the Listeners for multiple classes with <strong>&lt;listener&gt; tag</strong> in testng.xml.</li></ul><p><strong>Happy Testing !</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1655e98f281e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>