<?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 Venkat S on Medium]]></title>
        <description><![CDATA[Stories by Venkat S on Medium]]></description>
        <link>https://medium.com/@venkatsiva?source=rss-8a2f720e75ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*QZ-1Ma0ZwwRwPukL</url>
            <title>Stories by Venkat S on Medium</title>
            <link>https://medium.com/@venkatsiva?source=rss-8a2f720e75ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:49:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@venkatsiva/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[Mobile UI Test Automation Beyond Appium]]></title>
            <link>https://medium.com/@venkatsiva/mobile-ui-test-automation-beyond-appium-d906b9242daa?source=rss-8a2f720e75ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/d906b9242daa</guid>
            <category><![CDATA[mobile-testing]]></category>
            <category><![CDATA[xcuitest]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[espresso]]></category>
            <category><![CDATA[appium]]></category>
            <dc:creator><![CDATA[Venkat S]]></dc:creator>
            <pubDate>Mon, 15 May 2023 23:19:06 GMT</pubDate>
            <atom:updated>2023-05-15T23:29:46.439Z</atom:updated>
            <content:encoded><![CDATA[<p>Are you someone who is currently using Appium and thinking of ways to expand your mobile test automation skills? Are you currently doing web automation and trying to learn a mobile UI test automation framework? Are you curious about the different frameworks available for mobile test automation in the market? If you answered <strong>yes</strong> to any of these questions, this article is for you.</p><p>Firstly, why take Appium as a reference point for this article? It is because <strong>Appium is one of the most widely used mobile test automation frameworks</strong>. There are multiple reasons for that, e.g. — <strong>being open source, being platform independent, and ability to support multiple language bindings like Java, Python, etc</strong>. So it is generally the first choice for organizations for their automation strategy and subsequently for engineers to learn.</p><p>But Appium is not the only tool/framework that is available in the market. We will look into some of the alternatives which you are likely to come across. These tools address some challenges with Appium e.g. some offer native visibility into app architecture. While some do not have the flexibility that Appium provides. <strong>Which tool is right for you will depend on your organization’s strategy, requirements, available skillset, etc.</strong></p><blockquote><strong>NOTE</strong>: This article will only act as a guide for different tools available in the market, and direct readers to read more on each of those tools. This will not be a detailed instruction on working with any individual tools/frameworks.</blockquote><h4>XCUITest (only iOS)</h4><p>XCUITest was one of the first frameworks I learned after Appium. The transition was quite easy because of 2 major reasons —</p><ol><li><strong>Swift</strong> (with which the XCUITests are written) is similar to Java/JavaScript</li><li>Apple does an awesome job in providing this <strong>framework as a complete package</strong>, you don’t have to learn and integrate additional support libraries (like JUnit/TestNG, Maven/Gradle, Extent Reports, etc.).</li></ol><p>You start by creating test targets and schemes, then write tests, run them, view reports, and debug issues with breakpoints everything within <strong>Xcode</strong>. If you want to run your tests on a terminal or <strong>CI/CD use ‘xcodebuild’</strong>. That’s how easy it is.</p><p>The only caveat though? You will have to do all these <strong>on the same repo the app code exists</strong> (think of <strong>white-box testing</strong>). And you will probably need a Mac to work with. If this is not possible, this may not be a suitable framework for you. Read more <a href="https://www.hackingwithswift.com/articles/83/how-to-test-your-user-interface-using-xcode">here</a>.</p><blockquote>I had previously written a detailed article on many advantages of XCUITests I saw over Appium. You can read it <a href="https://medium.com/@venkatsiva/advantages-of-xcuitest-over-appium-part-1-60f23fe67334">here</a>.</blockquote><h4>Espresso (only Android)</h4><p>Espresso is similar to XCUITest in a few ways. It is also a white-box testing tool, you need the app code to work on Espresso tests. But the similarity ends there. Espresso tests are written in <strong>Kotlin</strong> (though Java is supported I have rarely seen it being used for Android app development these days). Learning Kotlin syntax takes time if you are from a Java background and even longer if you are new to programming. You will also need an intermediary level of knowledge on <strong>Gradle</strong> and <strong>platform-tools like adb</strong> to work with Espresso. Test development happens in Android Studio and tests can be run on CI/CD using Gradle commands. Read more <a href="https://developer.android.com/training/testing/espresso">here</a>.</p><h4>Compose Testing (only Android)</h4><p>Compose Testing is the recent version of native Android automation (the older one being Espresso) to support apps based on Jetpack Compose<strong> UI. It is similar to Espresso in the way it works but uses a different syntax</strong>. It is also possible to use Compose Testing to automate apps that have certain screens written in Jetpack Compose and others with views. Compose Testing was introduced in the last couple of years as the Jetpack Compose itself is pretty new. So <strong>you may find it difficult to find answers online when you run into issues</strong> with this. Read more <a href="https://developer.android.com/jetpack/compose/testing">here</a>.</p><p><strong>Another notable mention</strong> is — <strong>UI Automator</strong>. Though I have personally not used this, I have seen this being a very capable framework. The <strong>syntax is not user-friendly</strong> and it may be difficult setting up a framework just based on UI Automator, but I am sure some organizations do this. I will be curious to learn how they do it. Read more <a href="https://developer.android.com/training/testing/other-components/ui-automator">here</a>.</p><blockquote>Here is something that might surprise you — <strong>did you know that Appium by itself uses XCUITest for iOS and UI Automator 2 or Espresso for Android under the hood</strong>? You can read more on this on the Appium architecture pages <a href="https://appium.github.io/appium.io/docs/en/drivers/ios-xcuitest/">here</a> and <a href="https://appium.github.io/appium.io/docs/en/drivers/android-uiautomator2/">here</a>.</blockquote><h4>Appium Wrappers</h4><p>There are also frameworks based on Appium which try to resolve some challenges with it like providing advanced waits, assertions, simpler syntax, etc. One such framework I have come across and tried a bit is <strong>Selenide</strong>. I have seen this framework gain a lot of traction recently. Read more about it <a href="https://github.com/selenide/selenide-appium">here</a>.</p><h4><strong>Bonus</strong></h4><p>I am finally introducing a brand new and lesser know framework called <strong>Maestro</strong>. This is my current go-to framework for simpler apps being developed in my organization (anything with a less complex test design). <strong>It is lightweight and gets the job done seamlessly</strong>. I will keep watching this framework on how it evolves in the coming months/years to see if it scales up to the level of other frameworks above. If you have an Android app that you want to automate with an easy, low-code tool, look no further than <a href="https://maestro.mobile.dev/">Maestro</a>.</p><p>Now, having talked about all these amazing frameworks, the ultimate question is, <strong>whether any of these pose a real threat to Appium</strong>. My straightforward <strong>answer will be NO</strong>. All these tools are designed for specific purposes and address specific concerns. I don’t think any tool has major advantages over the other to make the other obsolete. Given the advantages of Appium mentioned at the very beginning of the article, there is no real threat to its growth and adoption anytime soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d906b9242daa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Considerations for a Java-based Test Automation Framework — Part 2]]></title>
            <link>https://medium.com/@venkatsiva/considerations-for-a-java-based-test-automation-framework-part-2-a97ac140fa0d?source=rss-8a2f720e75ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/a97ac140fa0d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[test-automation-framework]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Venkat S]]></dc:creator>
            <pubDate>Sun, 30 Apr 2023 19:32:30 GMT</pubDate>
            <atom:updated>2023-04-30T19:32:30.195Z</atom:updated>
            <content:encoded><![CDATA[<h3>Considerations for a Java-based Test Automation Framework — Part 2</h3><p>This is a continuation of a 2 part of series. If you haven&#39;t read the first part already, you can read it <a href="https://medium.com/@venkatsiva/considerations-for-a-java-based-test-automation-framework-part-1-982185a47b18">here</a>.</p><p>In the first part, we looked at the importance and selection of language, automation tools, build automation, source control, etc. Let us look at a few more components that are important for building a robust framework.</p><h4>Consideration 6 — File Readers and Connections</h4><p>If you have done coding before, you must know by now that <strong>not all data related to your code is hard-coded into the code itself</strong> (if you are doing it, this is wrong!). There are several benefits of having reusable data in a central place, the foremost of which is — <strong>when something changes you don’t have to modify it at multiple places</strong>.</p><p>Examples of data that are maintained separately are <strong>Environment Data, User Credentials, URLs, etc</strong>. There are several ways to store and manage this data. The common ways are using:</p><ul><li>Property files</li><li>Excel documents</li><li>Database</li></ul><p>Java provides in-built I/O functions to read from Property files. For data stored in a database, you will have to implement a <strong>JDBC connection</strong> to read/write data. And for Excel documents, you will depend on an external library like <strong>Apache POI</strong> for interactions. You will have to consider these when setting up the framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dxL195zTaqQMB_AnnXodhA.png" /><figcaption>Sample Test with JDBC Connection</figcaption></figure><h4>Consideration 7 — Loggers</h4><p>System.out.println(&quot;Hello world”); will probably be the first program any Java programmer will write. This is carried forward as we progress and even in complex programs running complex applications, the print statements are still being used to print information to the console.</p><p>There is nothing wrong with this approach (unless we are overdoing it) but this <strong>information is not retained</strong> and is not shareable. If you wanted to have information (or in other words, ‘logs’) written somewhere where it will not be lost or overwritten, you use a logger framework. Having logs is very important in any software development, including test automation because it <strong>helps in debugging issues and failures</strong>.</p><p>The common loggers used are <strong>log4j</strong> and <strong>slf4j</strong>. These utilities help us <strong>write information from tests (e.g. test name, assertions, callouts, etc.) into a file with timestamps</strong>. There are a lot of configurations you can play with here, but overall having a logger component for your framework is important for the above reasons.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*FKpyMJmiVQQaNhobcT0V4g.png" /><figcaption>Sample Logs from Log4j</figcaption></figure><h4>Consideration 8 — Reporting</h4><p>We have seen in previous sections about testing frameworks like JUnit and TestNG and reporting capabilities they provide. <strong>TestNG produces better reports of the two, with an HTML version</strong> that can be <strong>hosted on a server</strong> or shared with stakeholders for reviewing results.</p><p>If you want to take this to a next level, you can also consider integrating a reporting utility like <strong>Extent</strong> or <strong>Allure</strong> reports, to get a <strong>better-looking</strong> report with <strong>more features/functionality e.g. adding screenshots</strong>. This is just an enhancement step and optional if you are good with the reports generated by TestNG.</p><blockquote>Let us step into some advanced topics now, having covered the basics so far.</blockquote><h4>Consideration 9 — Test Environment</h4><p>When you have your framework and start building your tests, it is fine running the tests on your local machine initially. But soon, the <strong>number of tests increases in size, and running them all on your local machine/browser becomes extremely challenging</strong>.</p><p>If tests are run sequentially, it is going to lot of time to complete a suite. For running in parallel you need hardware strong enough to support all the load. The solution to this is <strong>running the tests remotely — virtual machines, docker, or cloud</strong>.</p><p>Running tests on <strong>docker containers with selenium-grid</strong> is gaining more traction these days given its simplicity, being open-source, and support from the community. If setting up and maintaining the infrastructure is too complex for you, the other options are using paid cloud partners like <strong>BrowserStack</strong>, <strong>SauceLabs</strong>, <strong>Perfecto</strong>, <strong>Digital.ai</strong>, etc.</p><p>Setting up your environment on cloud providers like <strong>AWS</strong> and <strong>Azure DevOps</strong> is also an option for enterprise-level automation efforts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qAJ69dOS9m9gKDgD4RBCw.png" /><figcaption>Sample Docker Setup with Selenium Grid</figcaption></figure><h4>Consideration 10 — CI/CD</h4><p>CI/CD stands for <strong>Continuous Integration</strong> and <strong>Continuous Delivery</strong>. This includes automating a <strong>cycle of events from building the code to deploying the application</strong>. This is a high level of what a CI/CD pipeline might look like — The developer writes the code and commits to a code repository, the code is built, automated tests are run, the application gets deployed and test results are published.</p><p>This has become almost an <strong>essential part of test automation frameworks at an enterprise level</strong> for the multiple benefits it offers in determining software quality and providing results quickly. We will not go into the details of those benefits in this article, but it is something worth investing time in understanding.</p><p>Some common tools used for CI/CD are <strong>Jenkins</strong>, <strong>Azure DevOps</strong>, and more recently <strong>Github Actions</strong> is gaining some traction. There are also other providers like <strong>Bamboo</strong>, and <strong>Travis CI</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kT3OhxathjaG9mFBKtPPgw.png" /><figcaption>Sample Test Run with GitHub Actions</figcaption></figure><p>And that concludes the 2-part series on considerations for a Java-based test automation framework. Did I miss something? Let me know in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a97ac140fa0d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Considerations for a Java-based Test Automation Framework — Part 1]]></title>
            <link>https://medium.com/@venkatsiva/considerations-for-a-java-based-test-automation-framework-part-1-982185a47b18?source=rss-8a2f720e75ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/982185a47b18</guid>
            <category><![CDATA[qa]]></category>
            <category><![CDATA[automation-tools]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[test-automation-framework]]></category>
            <category><![CDATA[selenium]]></category>
            <dc:creator><![CDATA[Venkat S]]></dc:creator>
            <pubDate>Fri, 21 Apr 2023 23:49:45 GMT</pubDate>
            <atom:updated>2023-04-21T23:49:45.872Z</atom:updated>
            <content:encoded><![CDATA[<h3>Considerations for a Java-based Test Automation Framework — Part 1</h3><p><strong>Frameworks</strong> — Anyone who is starting their test automation journey will always be fascinated by the word “framework”. And anyone who has spent a few years automating tests would have had some kind of exposure to modifying or setting up a framework. So what exactly is it? How does one start thinking about frameworks and build one from the ground up? Let us see this in detail.</p><h4>What is a Framework?</h4><p>A framework is a fundamental structure used as a basis for something being constructed. In the test automation world, we will be constructing tests. So why do we need frameworks? It helps us be organized and have a structured code that is both maintainable and scalable. It will help us build our tests easier and faster. A framework is an integration of several components satisfying several needs. We will look at the different components of a Java-based framework for test automation in this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*M-Fi8Z1lPR1QkBNUUCqKrA.png" /><figcaption>An Analogy for Components as Building Blocks of Framework</figcaption></figure><blockquote>Note: We will be focusing on open-source and black-box test tools here like Selenium, Appium, Cucumber, etc., as that is where most beginners start their test automation journey. But some of the concepts are applicable universally.</blockquote><blockquote>There will be a follow-up article on some proprietary frameworks like XCTest, Espresso, etc. which may not need many of the components listed below.</blockquote><h4>Consideration 1 — Programming Language</h4><p>This is probably where most of the frameworks start as this determines a lot of other components we will use. There are several factors to consider before finalizing a language. While we will not go into the details of things to consider in this article, <strong>it will typically be closely related to the language with which the application under test (AUT) is written</strong>.</p><p>E.g., if the AUT is a web application, the language choices can be <strong>JavaScript</strong>, <strong>Java,</strong> and in some cases <strong>Python or C#</strong>. If the AUT is a mobile native app, and you plan to do white-box testing there are options like <strong>Swift</strong> for <strong>iOS</strong> and <strong>Kotlin</strong> for <strong>Android</strong>.</p><p>There is no hard and fast rule here and you take a call based on a discussion with your team and your developers. It is also worth noting the <strong>design principles</strong> (e.g. <strong>Page Object Model</strong>) and <strong>patterns</strong> to follow based on the language chosen as it will be crucial in writing readable and maintainable code.</p><h4>Consideration 1.1 IDE/Development Environment</h4><p>This is not exactly a framework component, which is why this is a sub-category of Consideration 1. An IDE is an environment where you will be writing your tests. It makes sense to decide on this earlier as there may be a point where you will be <strong>using plugins specific to an IDE</strong> and it may not be easy to port from one to another mid-way into the test development.</p><p>Some common examples of IDE used for test frameworks in Java are <strong>IntelliJ</strong>, <strong>Eclipse</strong>, and JavaScript — <strong>VS Code</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i1YWN-sQ_vw83mYq2I5qlQ.png" /><figcaption>Eclipse IDE</figcaption></figure><h4><strong>Consideration 2 — Automation Tool/Library</strong></h4><p>The automation tool or library you plan to use <strong>is the main driver for your automated tests</strong>. You can think of this as a component that is going to convert commands in a programming language to actions on the web browser or mobile app.</p><p>There are many open-source libraries available for this, which we will integrate into our framework. <strong>One of the most famous examples in this context</strong> <strong>is Selenium</strong> <strong>or more specifically Selenium WebDriver</strong>. It is one of the most widely used libraries for web browser automation and if you are reading this article, you probably know this already 🙂.</p><p>The other commonly used tools/frameworks are (<em>as of this writing</em>):</p><ul><li><strong>Web — Cypress, Playwright, etc.</strong></li><li><strong>Mobile — Appium, UIAutomator, Espresso, XCUITest, etc.</strong></li><li><strong>API — RestAssured, SoapUI, etc.</strong></li></ul><h4>Special Consideration 2.1 — BDD</h4><p>BDD or Behavior Driven Development is a special approach in writing tests that are focussed on collaboration between <strong>Developers, Business Analysts, and Testers (the 3 amigos)</strong>. In this approach, the tests are written in simple English in a special <strong>syntax called Gherkin</strong>. It is integrated behind the scenes with test frameworks (like Selenium) to run the tests.</p><p>While this is not necessary for all test frameworks, if you plan to have a BDD approach to your project, you can consider this step. One of the most widely used tools for this is <strong>Cucumber</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9VsVfpZwIfjBaPMnrMAZA.png" /><figcaption>Sample Cucumber Test in Gherkin Syntax</figcaption></figure><h4>Consideration 3 — Build Automation and Dependency Management</h4><p>Once we have identified the programming language and main test library, we will start integrating all other components we need. This may include components for running tests, logging, reporting, etc. But before we get to that stage <strong>we need a tool to manage all these dependencies and help with build automation</strong>.</p><p>The fundamental idea behind having a tool to manage all dependencies and builds is<strong> to maintain a uniform configuration across all developer machines</strong>. That is, to maintain the same set of components and the same versions of those to avoid conflicts or unexpected behavior.</p><p>Two of the most common tools for this are <strong>Maven</strong> and <strong>Gradle</strong>. Which one you chose is again based on your programming language, your integration plans with other tools, etc.</p><h4>Consideration 4 — Source and Version Control</h4><p>If you are the only person working on creating tests for an application, you can maintain your code easily on your local machine (assuming your machine doesn’t fail someday 🙂). But at the enterprise level, it is rarely the case. <strong>There are always multiple people working on an automation project</strong>.</p><p>Let us assume you are fixing some code in the login module and your peer is also working on the same module. If both of you are making changes to the same file, either of your changes may get over-written. To avoid this, <strong>it is a good practice to maintain the code in a central repository where everyone can ‘pull’ from, make their changes, and ‘push’ it back.</strong></p><p>The <strong>source control system will act as a source of truth</strong>. The common repositories used are <strong>GitHub</strong> and <strong>BitBucket</strong>. The system that enables this with features like push, pull, and commit is called <strong>Git.</strong> This setup will also act as a warning mechanism to code/merge conflicts when more than one developer is updating the same file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zOT_DhQfAPIPOWfxI7T1hQ.png" /><figcaption>Sample Pull Request and Merge</figcaption></figure><h4>Consideration 5— Testing Framework (Java only)</h4><p>When working on a Java-based test automation suite, it is easier to have a framework or runner like <strong>TestNG</strong> or <strong>JUnit</strong> to drive your tests. This allows us to have flexible configurations like:</p><ul><li>Using annotations and assertions</li><li>Using test parameters</li><li>Support for data-driven tests (like DataProvider)</li><li>Support for test reports</li><li>Support for parallel runs</li></ul><p>This is essential to customize our suite as per our strategy and run tests based on that. As mentioned above, TestNG and JUnit have been widely used for Java-based projects. For other frameworks, this may not be required as they either have these features built-in or are integrated differently.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PXaODv47aRIFfvSIDus-gg.png" /><figcaption>Sample TestNG Test with Parameter and Annotation</figcaption></figure><p>In the next part of this article, we will look at a few other important components like file readers, reporting, remote test execution, CI/CD, etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=982185a47b18" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advantages of XCUITest over Appium — Part 2]]></title>
            <link>https://medium.com/@venkatsiva/advantages-of-xcuitest-over-appium-part-2-21885f69650e?source=rss-8a2f720e75ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/21885f69650e</guid>
            <category><![CDATA[mobile-automation-testing]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[xcuitest]]></category>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[ios-testing]]></category>
            <dc:creator><![CDATA[Venkat S]]></dc:creator>
            <pubDate>Sat, 03 Sep 2022 14:49:46 GMT</pubDate>
            <atom:updated>2022-09-03T14:49:46.443Z</atom:updated>
            <content:encoded><![CDATA[<h3>Advantages of XCUITest over Appium — Part 2</h3><p>This is a continuation of part 1 of the article where we started with a few advantages of XCUITest over Appium — like setup/configuration and speed of execution. If you haven’t read that already, I suggest you read it <a href="https://medium.com/@venkatsiva/advantages-of-xcuitest-over-appium-part-1-60f23fe67334">here</a>.</p><p><strong>Synchronization</strong></p><p>Synchronization in this context refers to the process of accommodating delays/lags in the app. This is done by anticipating page/view/activity load delays (for example) and making the code wait until the desired state is achieved before performing the next step.</p><p>In Appium this can be achieved in 3 ways— static waits (not recommended), implicit waits, and explicit waits.</p><ul><li>static waits — adding a Thread.sleep(milliSeconds)in Java code which makes the test execution halt for the specified seconds. This is not recommended as the wait is static and valuable execution time is wasted if the desired state is already achieved.</li><li>implicit and explicit waits — ability to set a timeout that is remembered by the test and <strong>ONLY</strong> used in any instance where the desired state is not achieved (e.g. an element is not found). This is done using the below syntax:</li></ul><pre>//implicit wait<br>driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);</pre><pre>//explicit wait<br>WebDriverWait wait = new WebDriverWait(driver, 10);      wait.until(ExpectedConditions.presenceOfElementLocated(<strong>MY_ELEMENT</strong>))</pre><p>Though there is nothing much to complain about the options available and flexibility, Appium still lacks native visibility into the app which is a problem and often leads to flakiness. In other words, Appium only knows to wait if the element is not found, not if the app is not ready to accept the next commands.</p><p>XCUITests handles this aspect gracefully. Without having to add any additional code, the app is always checked for readiness before the next set of commands is processed. This can be seen in the logs (as in the screenshot below)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nbF-bqdixSCH3g5DNgMcEA.jpeg" /><figcaption>Automatic Wait for Idle State in XCUITest</figcaption></figure><p>Further, if we are looking for a more Selenium/Appium-like wait strategy we can do that too using the syntax below, which waits for a specific element to be visible.</p><pre><strong>XCUIElement</strong>.waitForExistence(timeout: 10.0)</pre><p>Or a more elaborate option with XCTestCase expectation as below:</p><pre>let expectation = expectation(<br>    for: NSPredicate(format: &quot;exists == true&quot;),<br>    evaluatedWith: <strong>XCUIElement</strong>,<br>    handler: .none<br>)<br><br>let status = XCTWaiter.wait(for: [expectation], timeout: 10.0)<br><br>XCTAssertEqual(status, .completed)</pre><p>You can read more about this <a href="https://developer.apple.com/documentation/xctest/xctestcase/2806856-wait">here</a> and <a href="https://developer.apple.com/documentation/xctest/xctestcase/1500569-expectation">here</a>.</p><p><strong>Test Logs</strong></p><p>Logging test steps/outcomes in an Appium-based test is achieved — at a very basic level using Java’s System.out.println(&quot;my log&quot;) to print to console. But at an enterprise level, this can be done by integration with frameworks like <a href="https://logging.apache.org/log4j/2.x/"><strong>log4j</strong></a>,<strong> </strong><a href="https://qameta.io/allure-report/"><strong>Allure report</strong></a>,<strong> </strong>or<strong> </strong><a href="https://www.extentreports.com/"><strong>Extent report</strong></a>. This is important because if a test fails, we must be able to look at the logs and say at which step it is failing (or somewhere close) instead of having to re-run the test straight away. This integration takes additional effort to configure.</p><blockquote>Tip: Using the Cucumber BDD approach with Appium is also an excellent option to get step-level test insights.</blockquote><p>XCTest produces a .xcresult file that has so much information right out of the box that we don&#39;t have to go through the pain of adding separate steps for logging. Each step of the test is shown in the log in plain English with what it is trying to do, which is very useful.</p><p>When a test fails, the debugging capabilities available from the .xcresult file are something very unique and intuitive (includes: framework logs, device element tree, screenshots, etc.) that there can be a separate article talking only about that. But let’s park going into such a level of detail for now and look at the sample result file below of a passing test, just to see how useful this level of automatic logging is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/620/1*lXrivI8CColdf5HnLnv8RA.jpeg" /><figcaption>Sample XCUITest .xcresult file</figcaption></figure><p>This concludes the 2-part series on the advantages of XCUITest over Appium. I know this is not a full list here and there is a lot more to talk about these 2 amazing frameworks. But these are some of the first differences I observed when making the switch and i hope you find this useful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=21885f69650e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Advantages of XCUITest over Appium — Part 1]]></title>
            <link>https://medium.com/@venkatsiva/advantages-of-xcuitest-over-appium-part-1-60f23fe67334?source=rss-8a2f720e75ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/60f23fe67334</guid>
            <category><![CDATA[xctest]]></category>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[xcuitest]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Venkat S]]></dc:creator>
            <pubDate>Mon, 22 Aug 2022 00:01:24 GMT</pubDate>
            <atom:updated>2022-08-22T00:01:24.149Z</atom:updated>
            <content:encoded><![CDATA[<h3>Advantages of XCUITest over Appium — Part 1</h3><p><strong>XCTest</strong> framework from Apple is used to create and run unit, UI, and performance tests on mobile applications. Though the framework supports all 3 types of testing, we are going to focus on the UI testing part of the framework(XCUITest) to make it comparable with Appium.</p><p>If you are new to <strong>Appium</strong>, here is a definition of the framework, found on its official site—</p><blockquote>Appium is an open-source test automation framework for use with native, hybrid, and mobile web apps. It drives iOS, Android, and Windows apps using the WebDriver protocol.</blockquote><p>You can read more about the framework <a href="https://appium.io/">here</a>.</p><p>As you can see, straight out of the box Appium has an upper hand over several other frameworks, including XCUITest like — being able to automate native, web, and hybrid apps, cross-platform support for iOS and Android, etc. We will go into the details of this in a future article. The scope of this article is to look at the advantages of XCUITest over Appium.</p><p><strong>Setup and Configuration</strong></p><p>One of the biggest hurdles of setting up an Appium framework in a software testing project is its initial setup/configuration. There are numerous articles on the web detailing the process. At a high level this is what it looks like:</p><ol><li>Install JDK</li><li>Install Android Studio</li><li>Configure Environmental variables</li><li>Install Node.js</li><li>Install Appium Server</li><li>Download Appium Client Libraries and (optional) Desktop App</li><li>Install Eclipse/IntelliJ IDE</li><li>Create Appium Project in Eclipse/IntelliJ</li><li>Start Appium Server from CLI or Desktop App</li></ol><p>On the other hand, this is what it takes to set up your first XCUITest in Xcode:</p><ol><li>Install Xcode</li><li>Open the Application/Xcode project in Xcode</li><li>From ‘Test Navigator’ &gt; Click on ‘New UI Test Target’</li></ol><p>This will create a base test class as shown below, and running the test named “testExample” will get you into the action right away.</p><blockquote><strong>NOTE:</strong> One of the fundamental differences between test automation using XCUITest and Appium is that XCUITest is only suitable for projects where application code is available. Appium doesn’t have such a requirement and just a .apk or .ipa file either from the developer or from Play Store or App Store will do. In testing terminology, this is known as white/grey-box(app code is exposed to the tester) and black-box(app code is not exposed to the tester) testing.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21xMGV5oKwirMBNoCigE-A.png" /><figcaption>Default UI Test Class Provided by Apple</figcaption></figure><p>As you can see the difference is massive in terms of how easy Apple makes it to get started with automated UI testing with the XCUITest framework.</p><p><strong>Speed of Test Execution</strong></p><p>XCUITest is provided by Apple and is designed to work specifically with iOS apps on Xcode. The native support means the tests run using XCUITest are extremely fast. XCUITests paired with a simulator (though tests can also be run on real devices, cloud device farms, etc.) can give a test performance on par with what can be achieved manually or even better if we bring in the parallel-execution capabilities.</p><p>Appium struggles a lot in this area. It lies in the fundamental architecture of Appium wherein, several components are interacting with each other to execute commands on the device/simulator.</p><p>Appium follows client-server architecture wherein client libraries (e.g. Java) can be used to send HTTP requests to the Appium server using the JSON Wire Protocol. Appium server then sends the requests to the vendor-provided frameworks (Apple’s XCUITest or Google’s UIAutomator2) to perform the actions. So given this delay caused by its components, Appium tests are significantly slower than tests run using XCUITest.</p><blockquote><strong>DID YOU KNOW?</strong> Appium uses Apple’s XCUITest under the hood (wrapped inside the WebDriver API) when working with iOS devices.</blockquote><p>Let’s test this out. For this analysis, I am taking the <strong>UIKitCatalog</strong> app available <a href="https://github.com/appium/ios-uicatalog">here</a>. I used the .app file to install on an iOS simulator using Appium and used it for the Appium test. I used the .xcodeproj file to open the project in Xcode and run the XCUITest.</p><p>The test consists of the below steps:</p><ol><li>Tap on the menu “Search”</li><li>Tap on the menu “Default”</li><li>Enter a text in the search box</li><li>Tap “Cancel”</li><li>Navigate back twice to land on the main page</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*aMLAwdwEcgrWpZ_Iy3EvXg.gif" /><figcaption>Test for Performance Comparison</figcaption></figure><p>Keeping the influence of external factors to the minimum (Appium server was running before starting the appium test, the simulator was opened before both tests, Xcode project was built before starting XCUITest) this was the speed of execution:</p><ul><li><strong>Appium — 18.45 seconds</strong></li><li><strong>XCUITest — 11.49 seconds</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/1*USQRRzO5-cgCIyh7gb1VJA.png" /><figcaption>Appium — Java test on UIKitCatalog app</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*Iz6TlxyJpgF3hPDKmDkfkQ.png" /><figcaption>XCUITest on UIKitCatalog</figcaption></figure><p>So for this simple test, XCUITest was able to deliver results about 6–7 seconds faster than Appium. Note that both tests were run on simulators for convenience. If run on real devices, XCUITest may be giving an even better performance compared to Appium.</p><p>In part 2 of this article, let us look at a few other advantages of XCUITest over Appium like <strong>synchronization</strong>, <strong>logging</strong>, etc.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60f23fe67334" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with CI/CD (for continuous testing) using GitHub Actions]]></title>
            <link>https://medium.com/@venkatsiva/getting-started-with-ci-cd-for-continuous-testing-using-github-actions-f37caea1abf?source=rss-8a2f720e75ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/f37caea1abf</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[selenium]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[pipeline]]></category>
            <dc:creator><![CDATA[Venkat S]]></dc:creator>
            <pubDate>Fri, 05 Aug 2022 23:22:20 GMT</pubDate>
            <atom:updated>2022-08-05T23:29:50.236Z</atom:updated>
            <content:encoded><![CDATA[<p>I have always wanted to explore <strong>GitHub Actions</strong> and <strong>Workflows</strong> for CI/CD ever since it was introduced. Given that many of our projects are on GitHub, it only made sense to try out the additional offerings of the platform. Here’s a quick write-up on how easy it was to set up for a personal project.</p><blockquote>Note: As of today, a <strong>free account with GitHub</strong> offers 2000 mins of CI/CD for public repos. You can read more on the free tier <a href="https://github.com/pricing">here</a>.</blockquote><p>I took a very simple testing project, with test code written in <strong>Selenium-Java</strong> and wanted to achieve continuous testing using CI. The outcomes are below:</p><p><strong>TL;DR</strong> — GitHub Actions was one of the easiest and fastest CI/CD setups I have ever done.</p><p><strong>The Project</strong>:</p><p>1. As mentioned earlier, the project was a Selenium-Java based web automation script - to launch the chrome browser, hit a few websites, and get their title. That&#39;s it! nothing fancy.</p><p>2. The project was built using Maven, for the ease it offers in taking care of the dependencies.</p><p>3. The test was run in browser headless mode to avoid having to install the browser on virtual machines/agents (additional steps in pipeline).</p><p><strong>CI/CD Setup:</strong></p><ol><li>As soon as I hit the Actions tab in GitHub, the platform was intelligent enough to offer me a workflow template for ‘Java with Maven’ under the continuous integration category.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*m88afPONkWBNsFzYmgBcgA.png" /><figcaption>Workflow template for Java-Maven</figcaption></figure><p>2. The template had almost all the essential steps that I needed (say — triggers, jobs, stages, steps).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EXISsqdZtwp79KO6MiKAlQ.png" /><figcaption>Workflow YAML file</figcaption></figure><p>3. I could have either gone with the maven build command in the template to build and run the tests or simplified it to just run with ‘mvn clean test’. I chose the second option for simplicity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aIxHhsSEJ0bUoaguhP3h9A.png" /><figcaption>Workflow YAML file with updated Maven command</figcaption></figure><p>4. At a high level these are the tasks that are performed as part of the pipeline:</p><ul><li>Configure a trigger (by default all push/pull to the main branch, can be modified to run on other trigger types like daily, specific time, etc.)</li><li>Setup a virtual machine (I chose ubuntu).</li><li>Checkout the project code on the virtual machine.</li><li>Setup JDK based on the version selected.</li><li>Configure and run Maven — which will take care of all other dependencies.</li><li>Publish test results (more on this later in the article).</li></ul><p>5. Saving the changes created a pipeline yml file in the .github/workflows folder of the project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*zx1rrOwEjHouJ_Jm83R2MA.png" /><figcaption>Workflow file added to the repo on commit</figcaption></figure><p>6. That&#39;s it! the CI/CD pipeline was ready and already running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*m1hnaY_L6n1zfhfrdNRb5g.png" /><figcaption>Pipeline run with steps</figcaption></figure><blockquote>Note: The template by default has a trigger to run automatically whenever there is a push/pull to the specified branch, but this (and a lot of other things) can be customized.</blockquote><p>After the run was complete, the only other change I had to do was to add a test reporter step in the yml template to generate a beautiful report for test results.</p><pre>- name: Test Reporter      <br>uses: dorny/test-reporter@v1.5.0      <br>with:        <br>   name: GitHub Test Runs        <br>   path: &quot;**/surefire-reports/TEST-*.xml&quot;        <br>   reporter: java-junit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxsT6f5d97irsq6ua8p6Dw.png" /><figcaption>Test results published with Test Reporter</figcaption></figure><p>All it took me was 30 mins to get this whole thing set up. Of course, the duration will differ based on how complex your project is, but that&#39;s not the scope of this article.</p><p>GitHub repo link: <a href="https://github.com/venkat2789/github-actions-demo">https://github.com/venkat2789/github-actions-demo</a></p><p><strong>Bonus</strong> — Adding a badge for test status after a pipeline run was also as easy as it sounds. Just add these lines of code to your README file and a badge with the workflow test status is always shown.</p><pre>![A NAME FOR YOUR BADGE](path-to-your-yml-file<a href="https://github.com/venkat2789/github-actions-demo/actions/workflows/maven.yml/badge.svg">/badge.svg</a>)</pre><p>We can also get this from Actions &gt; Workflow &gt; Create status badge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/1*75i30fcHJCe8AfyPHlJstw.png" /><figcaption>Status badge added to README</figcaption></figure><p>I hope you enjoyed reading this article, please let me know in the comments if there are any specific questions on this approach. Thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f37caea1abf" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>