<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tejas Deshpande</title>
    <description>The latest articles on DEV Community by Tejas Deshpande (@tkdeshpande).</description>
    <link>https://dev.to/tkdeshpande</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F623941%2F3b217b6e-f782-4f32-a44d-0c02690bb130.jpeg</url>
      <title>DEV Community: Tejas Deshpande</title>
      <link>https://dev.to/tkdeshpande</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tkdeshpande"/>
    <language>en</language>
    <item>
      <title>Self Healing UI Test Automation</title>
      <dc:creator>Tejas Deshpande</dc:creator>
      <pubDate>Sun, 02 May 2021 19:30:17 +0000</pubDate>
      <link>https://dev.to/tkdeshpande/self-healing-ui-test-automation-4j2j</link>
      <guid>https://dev.to/tkdeshpande/self-healing-ui-test-automation-4j2j</guid>
      <description>&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Simulating human-machine interactions using UI Automation tools has been one of the best productivity improvements in validating application quality in a scalable and performant manner. &lt;/p&gt;

&lt;p&gt;However the possibility of dynamic selector(s) has always caused flaky tests and has been the cause for major reservations for many.&lt;/p&gt;

&lt;p&gt;Although experts know ways to robustly develop/fix automated UI tests, they are quite ill perceived by many others and are thereby avoided.&lt;/p&gt;

&lt;p&gt;We are going to checkout an easy way handle those dynamic selectors using &lt;a href="https://testproject.io" rel="noopener noreferrer"&gt;TestProject&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;TestProject provides us with a self healing test automation platform which renews failing locator using AI to identify new locators.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Here is how it works...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;For the sake of this tutorial I will be focusing on the test creation part.&lt;br&gt;&lt;br&gt;
For the installation guide &lt;a href="https://docs.testproject.io/getting-started/installation-and-setup" rel="noopener noreferrer"&gt;check here&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Test Setup
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create a new test by clicking on New Test and setting any desired &lt;em&gt;name&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;For this tutorial select &lt;strong&gt;Web&lt;/strong&gt; as the &lt;strong&gt;test type&lt;/strong&gt;. And click Next.

  Details (Step: 1 &amp;amp; 2)
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnit4xuyckvglhuz8tkg5.gif" title="New Test" alt="New Test"&gt; 

&lt;/li&gt;
&lt;li&gt;Now on the Select web application dialog, click on the &lt;strong&gt;Web applications&lt;/strong&gt; dropdown and select &lt;strong&gt;Add a new application for testing&lt;/strong&gt;.
&lt;em&gt;I will be using the &lt;a href="https://the-internet.herokuapp.com" rel="noopener noreferrer"&gt;the internet heroku app&lt;/a&gt; for this tutorial.&lt;/em&gt;
To follow along set following parameters:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Name: internet heroku app
URL: https://the-internet.herokuapp.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;
  Details
  &lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3iesnkmn9opl3l8192a.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk3iesnkmn9opl3l8192a.gif" title="New Application" alt="New Application"&gt;&lt;/a&gt; 

&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Since the AI based Self Healing functionality is available in the Web interface of TestProject, select to store the test on the cloud.&lt;/li&gt;
&lt;li&gt;For simplicity's sake I have used the recording feature to get you familiar with the UI of the test editor. This is the same UI that will assist us later to stabilize identification of the dynamic elements.

  Details
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7i38025ofvqqjvwblr4.gif" title="Get Started" alt="Get Started"&gt; 

&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Test Steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Launch &lt;a href="https://the-internet.herokuapp.com" rel="noopener noreferrer"&gt;the internet heroku app&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Click on Dynamic Content link.
  Details
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc56n6hyyo0696ndrp1j8.gif" title="Test Steps" alt="TestSteps"&gt; 

&lt;/li&gt;
&lt;li&gt;Select the first paragraph on the page for Dynamic Content and check if it is correctly recognized by highlighting it in the UI.
  Details
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn45ylexvjepp88jluqp9.gif" title="Select First Paragraph" alt="SelectFirstPara"&gt; 

&lt;/li&gt;
&lt;li&gt;Refresh page and try to highlight the same element again. This time it will fail since initially the achor was the text content itself which has now changed.
  Details
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftydmjtrvrn5ajz1o2ba2.gif" title="Select First Paragraph" alt="refreshpage"&gt; 


Now things get interesting. We have arrived at the stage where the dynamic element is not recognized by the automation. Now think... how can we fix this...
Think of all the ways in which you can fix this test to make it robust. Once you're done, read the next step.
&lt;/li&gt;
&lt;li&gt;Fixing the dynamic locator failure is as simple as re-running the test or specific step. TestProject will run AI analysis and finds a replacement locator. To avoid AI bias, you get approval over the selections.
  Details
  &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm57jspn0akgbohod0ero.gif" title="Update Locator" alt="updatelocator"&gt; 

&lt;/li&gt;
&lt;li&gt;Once confirmed go back to the test and re-run it as many times as you like and the dynamic content is handled just fine.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Using the power of AI to automatedly fix dynamic locators could never have been any easier. Although many coders are skeptical about record-playback style tools, I urge all to give it a shot. It just might be worth your time.&lt;/p&gt;

&lt;h2&gt;
  
  
  For more detailed illustration, refer following video:
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Pila6IZ3J6U"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>testautomation</category>
      <category>ai</category>
      <category>testing</category>
      <category>testdev</category>
    </item>
  </channel>
</rss>
