{"id":25829,"date":"2021-01-21T21:26:45","date_gmt":"2021-01-21T21:26:45","guid":{"rendered":"https:\/\/applitools.com\/?p=25829"},"modified":"2022-09-27T11:37:30","modified_gmt":"2022-09-27T18:37:30","slug":"visual-ai-hype-or-reality","status":"publish","type":"post","link":"https:\/\/applitools.com\/blog\/visual-ai-hype-or-reality\/","title":{"rendered":"Visual Assertions – Hype or Reality?"},"content":{"rendered":"\n

There is a lot of buzz around Visual Testing these days. You might have read or heard stories about the benefits of visual testing. You might have heard claims like, “more stable code,” “greater coverage,” “faster to code,” and “easier to maintain.” And, you might be wondering, is this a hype of a reality? <\/p>\n\n\n\n

So I conducted an experiment to see how true this really is.<\/p>\n\n\n\n

I used the instructions from this<\/a> recently concluded hackathon to conduct my experiment.<\/p>\n\n\n\n

I was blown away by the results of this experiment. Feel free to try out my code, which I published on Github, for yourself. <\/p>\n\n\n\n

Visual Assertions – my learnings<\/h1>\n\n\n\n

Before I share the details of this experiment, here are the key takeaways I had from this exercise:<\/p>\n\n\n\n

  1. Functional Automation is limiting. You only simulate known user behaviors, in predetermined conditions and in the process only validate & verify conditions what you know about. There has to be a more optimized and value generating approach!<\/li>
  2. The Automation framework should have advanced capabilities like soft assertions and good reporting to allow quick RCA. <\/li>
  3. Save time by integrating Applitools\u2019 Visual AI Testing with the Ultrafast Grid to increase your test coverage and scale your test executions.<\/li><\/ol>\n\n\n\n

    Let us now look at details of the experiment.<\/p>\n\n\n\n

    Context: What are we trying to automate?<\/h1>\n\n\n\n

    We need implement the following tests to check the functionality of https:\/\/demo.applitools.com\/tlcHackathonMasterV1.html<\/a><\/p>\n\n\n\n

    1. Validate details on landing \/ home page
      This should include checking headers \/ footers, filters, displayed items<\/li>
    2. Check if Filters are working correctly<\/li>
    3. Check product details for a specific product<\/li><\/ol>\n\n\n\n

      For this automation, I chose to use Selenium-Java for automation with Gradle as a build tool.<\/p>\n\n\n\n

      The code used for this exercise is available here: https:\/\/github.com\/anandbagmar\/visualAssertions<\/a><\/p>\n\n\n\n

      Step 1 – Pure Functional Automation using Selenium-Java<\/h1>\n\n\n\n

      Once I spent time in understanding the functionality of the application, I was quickly able to automate the above mentioned tests. <\/p>\n\n\n\n

      Here is some data from the same.<\/p>\n\n\n\n

      Refer to HolidayShoppingWithSeTest.java<\/a><\/p>\n\n\n\n

      Activity<\/th>Data (Time \/ LOC \/ etc.)<\/th><\/tr><\/thead>

      Time taken to understand the application and expected tests<\/p><\/td>

      30 min<\/p><\/td><\/tr>

      Time taken to implement the tests<\/p><\/td>

      90 min<\/p><\/td><\/tr>

      Number of tests automated<\/p><\/td>

      3<\/p><\/td><\/tr>

      Lines of code (actual Test method code)<\/p><\/td>

      65 lines<\/p><\/td><\/tr>

      Number of locators used<\/p><\/td>

      23<\/p><\/td><\/tr>

      \n

      Test execution time:<\/p>\n

      Part 1: Chrome browser<\/p>\n<\/td>

      32 sec<\/p><\/td><\/tr>

      \n

      Test execution time:<\/p>\n

      Part 2: Chrome browser<\/p>\n<\/td>

      57 sec<\/p><\/td><\/tr>

      \n

      Test execution time:<\/p>\n

      Part 3: Chrome: 29 sec<\/p>\n<\/td>

      29 sec<\/p><\/td><\/tr>

      \n

      Test execution time:<\/p>\n

      Part 3: Firefox: 65 sec<\/p>\n<\/td>

      65 sec<\/p><\/td><\/tr>

      \n

      Test execution time:<\/p>\n

      Part 3: Safari: 35 sec<\/p>\n<\/td>

      35 sec<\/p><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

      Observations<\/h2>\n\n\n\n

      A few interesting observations from this test execution:<\/p>\n\n\n\n

      1. I added only superficial validations for each test.