<?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 Nandasheetal on Medium]]></title>
        <description><![CDATA[Stories by Nandasheetal on Medium]]></description>
        <link>https://medium.com/@nandasheetal90?source=rss-d3b764c24ffd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*RYHi3WegDrn_Hzoa.jpg</url>
            <title>Stories by Nandasheetal on Medium</title>
            <link>https://medium.com/@nandasheetal90?source=rss-d3b764c24ffd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 21:13:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nandasheetal90/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[Platform Independent Framework for automating end-to-end flows]]></title>
            <link>https://medium.com/@nandasheetal90/platform-independent-framework-for-automating-end-to-end-flows-8763e5bf39d3?source=rss-d3b764c24ffd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8763e5bf39d3</guid>
            <category><![CDATA[cucumber]]></category>
            <category><![CDATA[test-automation-framework]]></category>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[cross-platform]]></category>
            <dc:creator><![CDATA[Nandasheetal]]></dc:creator>
            <pubDate>Fri, 13 Oct 2023 08:05:24 GMT</pubDate>
            <atom:updated>2023-10-13T08:05:24.049Z</atom:updated>
            <content:encoded><![CDATA[<p>Testing frameworks are an essential part of any successful automated testing process. They can reduce maintenance costs and testing efforts and will provide a higher return on investment (ROI) for QA teams looking to optimise their agile processes.</p><p>In this article, we will cover the ways of automating product scenarios end-to-end which run independently on different platforms. This also facilitates a user to use different data sources based on their needs. Hence, having automation scripts that run on any platform flawlessly is the need of the hour. Let’s get started and try to understand this in detail…</p><h4>Getting started with the framework architecture:</h4><p>If we look for open-source tools for laying the foundation of a framework, we end up with 2 different approaches: Behaviour Driver and Test Driven.</p><h4><strong><em>Cucumber(BDD):</em></strong></h4><p>Cucumber is an open-source software testing tool written in Ruby. It enables you to write test cases that anyone can easily understand regardless of their technical knowledge.</p><p>The Cucumber BDD framework mainly consists of three major parts:</p><ol><li><em>Feature File</em>: Cucumber tests are written in plain text files called feature files stored with the extension — “.feature”. These files describe the behaviour and functionality of the software using a specific syntax called Gherkin. Gherkin is a structured language that uses keywords like Given, When, and Then to define the steps of a test scenario.</li><li><em>Step Definitions</em>: Each step in a feature file is associated with a step definition implemented in the code. Step definitions define the actions or operations that must be executed for each step of the test scenario.</li><li><em>Test Runner File</em>: In Cucumber, the test runner file executes the Cucumber feature files and coordinates the steps defined in those feature files with the corresponding step definitions.</li></ol><p>The cucumber framework allows you to stay closer to the business requirements and keep up with the pace of sprints. Let’s try to understand this with an example:</p><pre>Feature: Login page and Auth API feature<br>  Background:<br>    Given user initializes the driver to open the browser<br>Scenario: Login page title<br>  Given the user is on the home page<br>  When clicking on the title of the page<br>  Then the page title should be &quot;Licious-Home Page&quot;</pre><h4>TestNG(TDD)</h4><p>TestNG (Test Next Generation) is the testing framework. TestNG is inspired by JUnit and NUnit, but it has a new functionality that makes this framework more powerful and easier. TestNG is designed in such a way that it covers all the categories of tests comprising unit, functional and integration.</p><pre>@BeforeTest<br>LaunchHomePage();<br><br>@Test(description = &quot;End to End customer flow&quot;)<br>  public void login() throws InterruptedException, SQLException, IOException {<br>    loginPage = new LoginPage();<br>    <br>    loginPage.loginValidation();<br><br>@AfterTest<br>Browser.close();<br>   </pre><p>After finalising the framework, the next step is to make it compatible with all platforms namely mobile, web and API. Let’s take an example of a maven command line run that can trigger a run based on the input value passed for the “<strong><em>platform</em></strong>” param.</p><pre>mvn -f test -Dcucumber.filter.tags=&quot;@sanity&quot; -DenvValue=staging -Platform={{platform}} -DheadLess=true -P SequentialRun</pre><p>The <strong><em>platform</em></strong> is the first parameter used for initiating the test run that initialises the driver</p><h4>How does it work?</h4><ul><li><strong><em>WebDriver</em></strong> interface is used to interact between web browsers and perform actions on them in web automation.</li><li><strong><em>AppiumDriver</em></strong> is consumed in this framework for bridging between the Appium server and mobile application allowing us to interact with applications under test thereby allowing us to switch between the OS of Android and iOS.</li><li>The intuitive methods of <strong><em>RestAssured</em></strong> Java Libraries are utilised for interacting with data in the API automation.</li></ul><p>The application details under test are maintained in the capabilities file as shown in the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Oy97eguX-wvI7BAc" /><figcaption>Fetching the platform value for initialising</figcaption></figure><p>When the platform is passed as “Android” a call to initAppiumDriver with the desired platform(Android/iOS) is triggered which sets the pre-requisites for running the tests on the desired device(s).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yRjwfxvFI96iD6LD" /><figcaption>Matching the platform passed for the driver initialisation</figcaption></figure><p><strong>Setting up the configurations:</strong></p><ul><li><strong><em>Mobile</em></strong>- In this example, we are using LambdaTest, a cloud-based testing platform that provides different configurations of mobile devices to run the mobile automation test scripts.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iXfT165brCq4F5Sx" /><figcaption>Capabilities passed for a platform to facilitate test run</figcaption></figure><ul><li><strong><em>Web</em></strong>- In this case, when we pass the platform as “web” and the browser as <strong><em>Chrome</em></strong>, the initializeWebDriver method will be called, which will set the required options for the Chrome browser.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*swngdwFyi-H5u1qE" /><figcaption>Capabilities set for web browser</figcaption></figure><p><em>Capabilities like running it in a headless mode or incognito mode can be handled through this function</em></p><h4>Implementing the helper methods</h4><p>With every platform, arises a challenge with action to be performed on screen while running the automation scripts. When we try to handle all platforms in a single framework, we must ensure we define all helper methods that can be utilised on any platform. These functions can be added to the utilities file for each platform. Let’s understand this better with an example here:</p><ul><li>Swipe function for mobile app</li></ul><pre># *********** Right to Left ************* #<br>startx2 = screenWidth/9<br>endx2 = screenWidth*8/9<br>starty2 = screenHeight/2<br>endy2 = screenHeight/2<br>actions = TouchAction(driver)<br>#perform the action swiping from Right to Left<br>actions.long_press(None,startx2,starty2).move_to(None,endx2,endy2).release().perform()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*VOcWD_gpdBJKPvYidYEJ4g.gif" /><figcaption>swipe function for mobile apps</figcaption></figure><ul><li>Scroll function for Web application</li></ul><pre>public void scrollForWebElement(WebDriver driver, int cord1,int cord2){<br>    ((JavascriptExecutor) driver).executeScript(&quot;scroll(&quot;+cord1+&quot;,&quot;+cord2+&quot;);&quot;);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*JikdmqZ5VUU0fBNH1I9cdA.gif" /><figcaption>Scroll down function in the web</figcaption></figure><h4>How to handle locators for different platforms?</h4><p>How does the driver know which element to click and which locator to identify on the page? The solution is simple.</p><p>When the driver is initialised, it sets the value accordingly and based on that it picks up the locator from your page factory file. Let’s take an example here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-TXGIKRodnIrhlpjTvO9Q.png" /><figcaption>Locator for test execution on iOS and Android platforms</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*o1AmKhV8RHmrGTe0H2V-Sg.png" /><figcaption>Test file example for calling elements</figcaption></figure><h4>An Overview of the architecture:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6kvVfIc3Ti0TlOvt_7kSNw.gif" /><figcaption>A pictorial representation of the framework</figcaption></figure><h4>Conclusion:</h4><p>A platform-independent framework enables you to maintain a single framework for your needs. This allows you to add or modify any feature by making changes in a single repository. No more hassle of updating the same changes in multiple test cases.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8763e5bf39d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>