<?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 Padma Deenadhayalan on Medium]]></title>
        <description><![CDATA[Stories by Padma Deenadhayalan on Medium]]></description>
        <link>https://medium.com/@padma.deenadayalan?source=rss-8b88f3f990e4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*PbL3vgT1i4uII6rE</url>
            <title>Stories by Padma Deenadhayalan on Medium</title>
            <link>https://medium.com/@padma.deenadayalan?source=rss-8b88f3f990e4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 22:01:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@padma.deenadayalan/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[Re-Run Failed TestCases Using TestNG iRetryAnalyzer]]></title>
            <link>https://medium.com/@padma.deenadayalan/re-run-failed-testcases-using-testng-iretryanalyzer-649f2fe77396?source=rss-8b88f3f990e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/649f2fe77396</guid>
            <dc:creator><![CDATA[Padma Deenadhayalan]]></dc:creator>
            <pubDate>Thu, 10 Nov 2022 18:16:25 GMT</pubDate>
            <atom:updated>2022-11-10T18:19:51.202Z</atom:updated>
            <content:encoded><![CDATA[<p>In Automation Testing, sometimes the test cases fail due to random problems like server issues, browser issues, element not found, network glitch, and so on. Some tests are dependent on each other and when a test fails maybe we want to run the tests again in order to confirm whether it really fails because of the product bug.</p><p>There are three ways to re-run failed test cases:</p><p>1.testng-failed.xml</p><p>2.IRetryAnalyzer Interface</p><p>3.IAnnotationTransformer (I) and IRetryAnalyzer (I)</p><p>Let’s see everything in detail.</p><p><strong>1. Using testng-failed.xml</strong></p><p>Here I have 2 test cases, 1 test case fails and the other one that passes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ND9IfRq09PSjJ-t-VqEDTw.png" /></figure><p>Create a testing.xml file by Right clicking on project=&gt; TestNG=&gt; Convert to TestNG</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7YXzzjy9TA-N_ohrPABSGQ.png" /></figure><p>Next run the testng.xml fileby Right Clicking =&gt; Run As=&gt;TestNG Suite</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khIZp50ORN6ujOrmIOS-iA.png" /></figure><p>Now the Console output will show as 1 test passed and 1 test failed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4-ItIBO6t-e1cQaRoCtjiQ.png" /></figure><p>Failed test cases will be stored in the testng-failed.xml file in the test-output folder. We can re-run the failed test cases alone manually in this file. Below is the screenshot of the failed test case in the testngfailed.xml file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfbpPhr2HiXWuxVjOmaszw.png" /></figure><p>2.Using IRetryAnalyzer Interface.</p><p>Create a separate Class that implements this IRetryAnalyzer like below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fcfkPP0mVh2oS9NLGK6_nw.png" /></figure><p>Here limit count can be increased or decreased to re-run the test cases. In the above example, failed test cases will run 3 times till it passes. In case it fails the third time, test execution will stop and TestNG will mark this case as failed.</p><p>Next implement retryAnalyzer attribute using @Test annotation for the failed test cases.</p><p><strong>@Test(retryAnalyzer = RetryListener.class)</strong></p><p><strong>public void testCase() {</strong></p><p><strong>}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cjIJHq-T7o8_iqNYIDjiFQ.png" /></figure><p>In the above scenario, failed test re-runs 3 times and it fails during each execution and marked as test failed. However, passedTest executed and passed at the first execution as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*IcDe6SpB6U6vYgyvOW7_ZQ.png" /></figure><p>3.Using IAnnotationTransformer interface.</p><p>Inorder to avoid implementing retryAnalyzer attribute every time @Test level for the failed test cases, we create a implemented class of IAnnotationTransformer interface and override transform method as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5ZgEtaKO0ef_bTbXIgRrig.png" /></figure><p>Now add the Listener to testng.xml file. Below is syntax to add listener for RetryListener.</p><p><strong>&lt;listeners&gt;</strong></p><p><strong>&lt;listener class-name=”iRetryAnalyzer.Transformer””/&gt;</strong></p><p><strong>&lt;/listeners&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zot91dK6SK1Abe0vnU3NpA.png" /></figure><p>After executing the program, The Test Output is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BUkHnC6Vx5MgrMSG0uUgsQ.png" /></figure><p><strong>Conclusion</strong></p><p>If you work on a test automation project, you’d know that the most difficult part of automation is the analysis of test executions. At the end of the execution, With the help of iRetryAnalyzer, you can analyze failed test cases and try to figure out if there’s any false positive/flaky situation caused by network glitch, time-out, or some other problem.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=649f2fe77396" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Selenium Grid 3]]></title>
            <link>https://medium.com/@padma.deenadayalan/selenium-grid-4-329ebd725dd?source=rss-8b88f3f990e4------2</link>
            <guid isPermaLink="false">https://medium.com/p/329ebd725dd</guid>
            <dc:creator><![CDATA[Padma Deenadhayalan]]></dc:creator>
            <pubDate>Sun, 02 Oct 2022 15:46:21 GMT</pubDate>
            <atom:updated>2022-10-04T01:43:28.140Z</atom:updated>
            <content:encoded><![CDATA[<p>(Explained using latest version of JAR file)</p><p>Selenium Grid is a smart proxy server that is used to execute test cases parallelly in multiple machines against different browsers. It is used to run tests against multiple browsers, multiple versions of browsers, and browsers running on different operating systems. And it reduces the time it takes for the test suite to complete a test pass.</p><p>The two major components of the Selenium Grid architecture are:</p><p><strong>Hub</strong>: Hub is the central point to the entire GRID Architecture which receives all requests. There is only one hub in the selenium grid. Hub distributes all the test cases across each node.</p><p><strong>Node</strong>: There can be multiple nodes in Grid. Tests will run in nodes. Each node communicates with the Hub and performs test cases assigned to it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/668/0*uIoxqAgTzcVyVvWV.png" /><figcaption>Figure 1.1</figcaption></figure><p><strong>Step 1: Installation</strong></p><p>Download the Selenium Server jar file from Selenium’s official website and save it at any location on the local disk.</p><p><strong>URL: </strong><a href="https://www.selenium.dev/downloads/">https://www.selenium.dev/downloads/</a></p><p><strong>Step 2: Start Hub</strong></p><p>Open the command prompt and navigate to a folder where the server is located. Run the server by using the below command</p><p><strong>java -jar selenium-server-4.3.0.jar hub</strong></p><p>By default, the hub will use port 4444. This port can be changed by passing the different port numbers in the command prompt provided the port is open and has not been already assigned a task.</p><p>The Command Prompt will be displayed like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WPeOM8_ekIRRrKu5.png" /><figcaption>Figure 1.2</figcaption></figure><p>You can view the status of the hub by opening a browser and navigating to <a href="http://localhost:4444/grid/console">http://localhost:4444/grid/console</a><em> and the Screenshot for the same is shown below.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dUjVJTYt_CtoGtZh.png" /><figcaption>Figure 1.3</figcaption></figure><p><strong>Step 3: Start Node</strong></p><p>Now to register the Nodes in the same machine, Open the command prompt and navigate to a folder where the server is located. Run the server by using below command.</p><p><strong>java -jar selenium-server-4.3.0.jar node — detect-drivers true</strong></p><p>Detect drivers will detect all the drivers in the local drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7caRRnYg3_-VSyde.png" /><figcaption>Figure 1.4</figcaption></figure><p>To register the Nodes in a different machine, Download the selenium server jar and the drivers in that machine and Run the below command.</p><p><strong>java -jar selenium-server-4.3.0.jar node — detect-drivers true — publish-events tcp://&lt;ipaddressofhub&gt; — subscribe-events tcp://&lt;ipaddressofhub&gt;</strong></p><p>XPUB and XSUB are the two sockets. In Figure 1.2, XPUB indicates the Publish events and XSUB indicates the Subscribe events, so the IP address of publish events will be <a href="http://192.168.1.156:4442/">http://192.168.1.156:4442</a> and the IP address of subscribe events will be <a href="http://192.168.1.156:4442/">http://192.168.1.156:4443</a>. This will register the node to the hub on another machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*74HwTMvHmBayGGR1.png" /><figcaption>Figure 1.5</figcaption></figure><p>In Figure 1.5, we can see that the Node has been added and it has the capability of running 8 Chrome browsers and 1 Safari browser.</p><p><strong>Step 4: Run Tests using Selenium Grid</strong></p><p>Once the Selenium Grid setup is done by following the above 3 steps, testers can run tests by accessing Grid.</p><p>Now Create <strong>RemoteWebDriver</strong> and <strong>Desired Capabilities</strong> objects to define the browser and platform. Then pass the set of browser capabilities into the <strong>RemoteWebDriver</strong> object as shown in Figure 1.6</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NpOU-J-4yg8dTbLN.png" /><figcaption>Figure 1.6</figcaption></figure><p>If these capabilities do not exist on the Grid, the code returns no match and thus the tests fail to run.</p><p>The Output of the above test cases is shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VGvHPISED985D9pH.png" /><figcaption>Figure 1.7</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=329ebd725dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>