<?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 Aman Kumar on Medium]]></title>
        <description><![CDATA[Stories by Aman Kumar on Medium]]></description>
        <link>https://medium.com/@amankumarbostan?source=rss-cdda35adcfb3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pR5hps7t-tom4rdHTGm8ng.jpeg</url>
            <title>Stories by Aman Kumar on Medium</title>
            <link>https://medium.com/@amankumarbostan?source=rss-cdda35adcfb3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 12:13:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amankumarbostan/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[The Beginner’s Guide to Android UI Automation with Espresso]]></title>
            <link>https://medium.com/@amankumarbostan/the-beginners-guide-to-android-ui-automation-with-espresso-779a116ba312?source=rss-cdda35adcfb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/779a116ba312</guid>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[test-automation]]></category>
            <category><![CDATA[android-espresso]]></category>
            <dc:creator><![CDATA[Aman Kumar]]></dc:creator>
            <pubDate>Mon, 18 May 2026 19:30:09 GMT</pubDate>
            <atom:updated>2026-05-18T19:30:09.657Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7WLc2HXkazn4-mh4uy2BlQ.png" /></figure><p>When most people start Android automation, they usually learn:</p><ul><li>simple button clicks</li><li>login validation</li><li>basic assertions</li></ul><p>But real Android apps are much more complex.</p><p>Modern apps contain:</p><ul><li>dynamic UI states</li><li>Compose screens</li><li>dialogs &amp; snackbars</li><li>lazy lists</li><li>navigation flows</li><li>form validations</li><li>asynchronous updates</li></ul><p>So instead of just learning isolated test cases, I wanted to understand:</p><blockquote><em>How do you build a proper Android UI automation project from scratch?</em></blockquote><p>That’s why I built <strong>UiTestify</strong> — a beginner-friendly Android application focused on learning modern UI automation using:</p><ul><li>Espresso</li><li>Jetpack Compose Testing</li><li>Kotlin</li><li>Accessibility best practices</li></ul><p>This blog is a practical walkthrough of:</p><ul><li>setting up Android UI automation</li><li>writing Compose &amp; Espresso tests</li><li>handling real-world UI scenarios</li><li>building reusable test architecture</li></ul><h3>Why I Created UiTestify</h3><p>While exploring Android automation, I noticed most demo apps were too simple.</p><p>They usually skip:</p><ul><li>loading states</li><li>accessibility</li><li>scrolling</li><li>reusable framework design</li><li>edge-case handling</li></ul><p>But in production apps, these things matter the most.</p><p>So I decided to build an app specifically for:<br>✅ practicing UI automation<br>✅ learning Espresso<br>✅ learning Compose Testing<br>✅ understanding accessibility<br>✅ improving test stability<br>✅ building reusable automation structure</p><h3>Project Tech Stack</h3><p>The project uses:</p><ul><li>Kotlin</li><li>Jetpack Compose</li><li>Espresso</li><li>Compose Test APIs</li><li>AndroidX Testing</li><li>Material 3</li></ul><p>This setup helps beginners learn both in one project.:</p><ul><li>traditional Android testing</li><li>modern Compose UI testing</li></ul><h3>Setting Up Android UI Testing</h3><p>The first step was configuring Android testing dependencies.</p><p>Inside build.gradle:</p><pre>androidTestImplementation(&quot;androidx.test.espresso:espresso-core:3.5.1&quot;)<br>androidTestImplementation(&quot;androidx.compose.ui:ui-test-junit4&quot;)</pre><p>This enables:</p><ul><li>Espresso testing</li><li>Compose testing</li><li>UI assertions</li><li>interaction APIs</li></ul><h3>Understanding Compose Testing</h3><p>Compose testing feels different from traditional Espresso testing.</p><p>Instead of view hierarchy matching, Compose uses semantics-based node matching.</p><p>Example:</p><pre>composeTestRule<br>    .onNodeWithText(&quot;Login&quot;)<br>    .performClick()</pre><p>This interacts directly with Compose nodes.</p><h3>Adding Stable Test Tags</h3><p>One of the first things I learned:</p><blockquote><em>Good locators make automation stable.</em></blockquote><p>For Compose screens, testTag() is extremely useful.</p><p>Example:</p><pre>Modifier.testTag(&quot;loginButton&quot;)</pre><p>Then inside tests:</p><pre>composeTestRule<br>    .onNodeWithTag(&quot;loginButton&quot;)<br>    .performClick()</pre><p>This makes tests:</p><ul><li>cleaner</li><li>reusable</li><li>less flaky</li></ul><h3>Writing the First UI Test</h3><p>Simple example:</p><pre>@Test<br>fun validateLoginButton() {<br>    composeTestRule<br>        .onNodeWithText(&quot;Login&quot;)<br>        .assertExists()<br>}</pre><p>This verifies that the Login button is visible on screen.</p><h3>Espresso vs Compose Testing</h3><p>The project uses both:</p><ul><li>Espresso</li><li>Compose Test APIs</li></ul><p>Espresso example:</p><pre>onView(withId(R.id.loginButton))<br>    .perform(click())</pre><p>Compose example:</p><pre>onNodeWithText(&quot;Login&quot;)<br>    .performClick()</pre><p>This helped me understand how Android automation is shifting toward Compose-first testing.</p><h3>Testing Real UI Scenarios</h3><p>Instead of only testing happy paths, UiTestify includes:</p><p>✅ Form validation<br>✅ Dialog testing<br>✅ Snackbar testing<br>✅ LazyColumn scrolling<br>✅ Empty state validation<br>✅ Loading state testing<br>✅ Navigation testing<br>✅ Back stack validation<br>✅ Accessibility checks</p><p>This makes the framework much more practical for learning.</p><h3>Handling LazyColumn Scrolling</h3><p>Scrollable lists are common in modern Android apps.</p><p>Compose testing allows scrolling directly to nodes.</p><p>Example:</p><pre>composeTestRule<br>    .onNodeWithText(&quot;Item 20&quot;)<br>    .performScrollTo()</pre><p>This is much cleaner compared to older RecyclerView handling.</p><h3>Accessibility Testing Matters</h3><p>Accessibility is one of the most ignored parts of automation.</p><p>UiTestify includes:</p><ul><li>accessibility labels</li><li>readable touch targets</li><li>proper semantics</li><li>accessibility-friendly UI design</li></ul><p>Better accessibility improves:</p><ul><li>automation reliability</li><li>user experience</li><li>maintainability</li></ul><h3>Common Mistakes Beginners Make</h3><h3>Using Thread.sleep()</h3><p>Bad:</p><pre>Thread.sleep(5000)</pre><p>Better:</p><pre>composeTestRule.waitForIdle()</pre><p>Fixed waits usually create flaky tests.</p><h3>Hardcoding Test Data</h3><p>Bad:</p><pre>typeText(&quot;test@gmail.com&quot;)</pre><p>Better:</p><pre>TestData.validEmail</pre><p>Cleaner and easier to maintain.</p><h3>Building Reusable Test Structure</h3><p>As tests grow, structure becomes important.</p><p>The framework eventually included:</p><ul><li>reusable helpers</li><li>centralized locators</li><li>shared utilities</li><li>cleaner assertions</li></ul><p>This made the project:</p><ul><li>easier to scale</li><li>easier to debug</li><li>easier to maintain</li></ul><p>🔗 GitHub Repository:<br><a href="https://github.com/codedbyaman/UiTestify">UiTestify Android Project</a></p><h3>Tips, Tricks &amp; Useful Snippets</h3><h3>Add testTag() for Stable Compose Locators</h3><pre>Button(<br>    modifier = Modifier.testTag(&quot;loginButton&quot;),<br>    onClick = { }<br>) {<br>    Text(&quot;Login&quot;)<br>}</pre><p>Use in test:</p><pre>composeTestRule<br>    .onNodeWithTag(&quot;loginButton&quot;)<br>    .performClick()</pre><h3>✅ Verify Text Exists</h3><pre>composeTestRule<br>    .onNodeWithText(&quot;Welcome&quot;)<br>    .assertExists()</pre><h3>✅ Perform Button Click</h3><pre>composeTestRule<br>    .onNodeWithText(&quot;Continue&quot;)<br>    .performClick()</pre><h3>✅ Type Text in TextField</h3><pre>composeTestRule<br>    .onNodeWithTag(&quot;emailField&quot;)<br>    .performTextInput(&quot;test@gmail.com&quot;)</pre><h3>✅ Clear Existing Text</h3><pre>composeTestRule<br>    .onNodeWithTag(&quot;emailField&quot;)<br>    .performTextClearance()</pre><h3>✅ Scroll to Hidden Item</h3><pre>composeTestRule<br>    .onNodeWithText(&quot;Item 20&quot;)<br>    .performScrollTo()</pre><h3>✅ Wait for Compose UI to Become Idle</h3><pre>composeTestRule.waitForIdle()</pre><p>Better than:</p><pre>Thread.sleep(5000)</pre><h3>✅ Verify Button Is Displayed</h3><pre>composeTestRule<br>    .onNodeWithTag(&quot;submitButton&quot;)<br>    .assertIsDisplayed()</pre><h3>✅ Check Snackbar Message</h3><pre>composeTestRule<br>    .onNodeWithText(&quot;Login Successful&quot;)<br>    .assertExists()</pre><h3>✅ Espresso Click Example</h3><pre>onView(withId(R.id.loginButton))<br>    .perform(click())</pre><h3>✅ Espresso Text Validation</h3><pre>onView(withText(&quot;Welcome&quot;))<br>    .check(matches(isDisplayed()))</pre><h3>✅ Use Accessibility Scanner</h3><p>Helpful for checking:</p><ul><li>touch target size</li><li>accessibility issues</li><li>contrast problems</li><li>usability improvements</li></ul><p>One of the best free tools for Android UI quality.</p><h3>Use printToLog() for Debugging</h3><pre>composeTestRule.onRoot().printToLog(&quot;UI_TREE&quot;)</pre><p>Very useful for inspecting Compose hierarchy.</p><h3>✅ Test Loading States</h3><pre>composeTestRule<br>    .onNodeWithTag(&quot;loadingIndicator&quot;)<br>    .assertExists()</pre><h3>✅ Test Error State</h3><pre>composeTestRule<br>    .onNodeWithText(&quot;Something went wrong&quot;)<br>    .assertExists()</pre><h3>✅ Test Empty State</h3><pre>composeTestRule<br>    .onNodeWithText(&quot;No Data Found&quot;)<br>    .assertExists()</pre><h3>✅ Reusable Helper Example</h3><pre>fun clickButton(tag: String) {<br>    composeTestRule<br>        .onNodeWithTag(tag)<br>        .performClick()<br>}</pre><p>Reusable helpers make frameworks cleaner and scalable.</p><h3>Quick Beginner Tips</h3><ul><li>Prefer testTag() over text-based locators</li><li>Avoid Thread.sleep()</li><li>Use reusable helper methods</li><li>Test loading, empty, and error states</li><li>Keep accessibility in mind while building UI</li><li>Use Compose Testing APIs for Compose screens</li><li>Start small, then gradually build reusable architecture</li></ul><h3>⚡Testing Hacks &amp; Tricks</h3><h3>✅ Run Specific Test Class</h3><pre>./gradlew connectedAndroidTest \<br>-Pandroid.testInstrumentationRunnerArguments.class=com.example.LoginTest</pre><p>Useful when debugging only one test.</p><h3>✅ Run Single Test Method</h3><pre>./gradlew connectedAndroidTest \<br>-Pandroid.testInstrumentationRunnerArguments.class=com.example.LoginTest#validateLogin</pre><p>Huge time saver during debugging.</p><h3>✅ Use useUnmergedTree</h3><p>Helpful when Compose cannot find nested elements.</p><pre>onNodeWithText(<br>    &quot;Login&quot;,<br>    useUnmergedTree = true<br>)</pre><h3>✅ Print Entire Compose Hierarchy</h3><pre>composeTestRule<br>    .onRoot()<br>    .printToLog(&quot;UI_TREE&quot;)</pre><p>Very useful for debugging hidden nodes.</p><h3>✅ Disable System Animations</h3><p>Animations often create flaky tests.</p><p>ADB command:</p><pre>adb shell settings put global window_animation_scale 0<br>adb shell settings put global transition_animation_scale 0<br>adb shell settings put global animator_duration_scale 0</pre><p>Massively improves test stability.</p><h3>✅ Use assertIsEnabled()</h3><pre>composeTestRule<br>    .onNodeWithTag(&quot;submitButton&quot;)<br>    .assertIsEnabled()</pre><p>Useful for form validation testing.</p><h3>✅ Verify Element Does NOT Exist</h3><pre>composeTestRule<br>    .onNodeWithText(&quot;Error&quot;)<br>    .assertDoesNotExist()</pre><h3>✅ Capture Screenshot During Tests</h3><pre>val device = UiDevice.getInstance(<br>    InstrumentationRegistry.getInstrumentation()<br>)</pre><pre>device.takeScreenshot(File(&quot;screenshot.png&quot;))</pre><p>Helpful for debugging CI failures.</p><h3>✅ Use waitUntil() for Dynamic UI</h3><pre>composeTestRule.waitUntil(5000) {<br>    composeTestRule<br>        .onAllNodesWithText(&quot;Success&quot;)<br>        .fetchSemanticsNodes().isNotEmpty()<br>}</pre><p>Great for async states.</p><h3>✅ Test Back Navigation</h3><pre>composeTestRule.activityRule<br>    .scenario.onActivity {<br>        it.onBackPressedDispatcher.onBackPressed()<br>    }</pre><h3>✅ Verify LazyColumn Item Count</h3><pre>composeTestRule<br>    .onAllNodesWithTag(&quot;listItem&quot;)<br>    .assertCountEquals(10)</pre><h3>✅ Use hasTestTag() Matcher</h3><pre>composeTestRule<br>    .onNode(hasTestTag(&quot;loginButton&quot;))<br>    .performClick()</pre><p>Cleaner and reusable.</p><h3>✅ Combine Matchers</h3><pre>composeTestRule.onNode(<br>    hasText(&quot;Login&quot;) and hasClickAction()<br>)</pre><p>Useful for complex UI.</p><h3>✅ Use assertTextContains()</h3><pre>composeTestRule<br>    .onNodeWithTag(&quot;message&quot;)<br>    .assertTextContains(&quot;Success&quot;)</pre><p>Perfect for dynamic messages.</p><h3>✅ Use UiAutomator for System UI</h3><p>Espresso/Compose cannot handle:</p><ul><li>notifications</li><li>permission dialogs</li><li>system settings</li></ul><p>Use UiAutomator:</p><pre>val device = UiDevice.getInstance(<br>    InstrumentationRegistry.getInstrumentation()<br>)</pre><pre>device.pressHome()</pre><h3>✅ Avoid Hardcoded Waits</h3><p>Bad:</p><pre>Thread.sleep(3000)</pre><p>Better:</p><pre>composeTestRule.waitForIdle()</pre><h3>✅ Use Semantics for Better Compose Testing</h3><p>Compose testing works through semantics tree.</p><p>Adding semantics improves:</p><ul><li>accessibility</li><li>testability</li><li>cleaner locators</li></ul><h3>🚀 Golden Rule</h3><blockquote><em>Good Android automation is not about writing more test cases. It’s about writing stable, reusable, and maintainable ones.</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=779a116ba312" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Beginner’s Journey to Building an iOS XCUITest Framework]]></title>
            <link>https://medium.com/@amankumarbostan/the-beginners-journey-to-building-an-ios-xcuitest-framework-ce63a29101e8?source=rss-cdda35adcfb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce63a29101e8</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[xcuit]]></category>
            <dc:creator><![CDATA[Aman Kumar]]></dc:creator>
            <pubDate>Tue, 12 May 2026 21:03:41 GMT</pubDate>
            <atom:updated>2026-05-12T21:29:10.089Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WAVMbt5Evm2ksh8h8HJ7Xw.png" /><figcaption>Build. Automate. Validate. Scale.</figcaption></figure><p>A few months ago, if someone had asked me about iOS automation, my answer would’ve been simple:</p><blockquote><em>“You need a MacBook for that.”</em></blockquote><p>That was pretty much the extent of my iOS knowledge.</p><p>My background was mostly around:</p><ul><li>Android automation</li><li>Selenium</li><li>Appium</li><li>API testing</li><li>Mobile QA workflows</li><li>Automation architecture</li></ul><p>I was comfortable writing automation frameworks, debugging flaky tests, handling CI/CD pipelines, and building scalable test suites.</p><p>But iOS?</p><p>Completely new territory.</p><p>Then I got my first MacBook.</p><p>And instead of just learning macOS basics, I decided to challenge myself:</p><blockquote><em>Can I build a complete iOS UI automation framework from scratch using XCUITest?</em></blockquote><p>That’s how <a href="https://github.com/codedbyaman/UITestify-iOS?utm_source=chatgpt.com">UITestify-iOS</a> started. Inspired by practical automation learning and real debugging experiences similar to the journey described in the reference article you shared.</p><p>This blog is not just about building tests.</p><p>It’s about:</p><ul><li>learning a completely new automation stack</li><li>solving real mobile automation problems</li><li>understanding XCUITest fundamentals</li><li>creating scalable UI automation architecture</li><li>and using AI tools intelligently during development</li></ul><h3>Why I Built UITestify</h3><p>Most beginner XCUITest tutorials focus on:</p><ul><li>tapping buttons</li><li>validating labels</li><li>basic login screens</li></ul><p><strong>But real-world mobile automation is much more than that.</strong></p><p>Production apps involve:</p><ul><li>asynchronous UI updates</li><li>timers</li><li>dynamic states</li><li>keyboard interruptions</li><li>scrolling issues</li><li>flaky interactions</li><li>accessibility challenges</li></ul><p>I wanted a playground where engineers could practice real automation problems without dealing with enterprise-level complexity.</p><p>So I created:</p><h3><a href="https://github.com/codedbyaman/UITestify-iOS?utm_source=chatgpt.com">UITestify-iOS Repository</a></h3><p>A lightweight iOS quiz application designed specifically for:</p><ul><li>learning XCUITest</li><li>practicing UI automation</li><li>understanding accessibility</li><li>improving automation stability</li><li>building scalable frameworks</li></ul><h3>What is UITestify?</h3><p>UITestify is a Swift + UIKit based iOS application that simulates a quiz flow.</p><p>The app includes:</p><ul><li>quiz navigation</li><li>timers</li><li>score calculation</li><li>result validation</li><li>reset flows</li><li>conditional button states</li></ul><p>While the UI looks simple, the automation challenges inside are very realistic.</p><h3>The Biggest Challenge Wasn’t Automation</h3><p>The hardest part was simply getting everything to work.</p><p>Coming from Android and web automation, I assumed:</p><blockquote><em>“I’ll install Xcode, run tests, and start automating.”</em></blockquote><p>Reality was very different.</p><h3>Step 1: Understanding the iOS Ecosystem</h3><p>The first few hours were spent understanding:</p><ul><li>Xcode</li><li>simulators</li><li>schemes</li><li>targets</li><li>XCTest</li><li>app launch behavior</li></ul><p>At this stage, I wasn’t even writing automation logic yet.</p><p>I was trying to answer:</p><ul><li>Why isn’t the app launching?</li><li>Why are tests failing before execution?</li><li>Why does the simulator freeze?</li><li>Why does accessibility fail?</li></ul><p>This phase taught me something important:</p><blockquote><em>Mobile automation setup is often harder than writing the actual tests.</em></blockquote><h3>Building the App for Automation First</h3><p>One thing I intentionally focused on was:</p><h3>Accessibility-Driven Development</h3><p>Every important element in the app uses accessibility identifiers.</p><p>Example:</p><pre>startQuizButton.accessibilityIdentifier = &quot;startQuizButton&quot;</pre><p>This small decision improves:</p><ul><li>test stability</li><li>locator reliability</li><li>debugging</li><li>framework scalability</li></ul><p>Without proper accessibility support, iOS automation quickly becomes fragile.</p><h3>Project Architecture</h3><p>The project structure was designed to stay clean and scalable from the beginning.</p><pre>uiTestify/<br>├── uiTestify<br>├── uiTestifyTests<br>├── uiTestifyUITests<br>├── Pages/<br>├── Helpers/<br>├── Base/<br>└── README.md</pre><p>As the automation suite grew, separating concerns became extremely important.</p><h3>Key Automation Scenarios Covered</h3><p>The app was intentionally designed with realistic automation challenges.</p><h3>1. Quiz Launch Validation</h3><p>The automation validates:</p><ul><li>app launch</li><li>initial screen rendering</li><li>button visibility</li><li>navigation readiness</li></ul><p>Example:</p><pre>func testQuizLaunch() {<br>    XCTAssertTrue(app.buttons[&quot;startQuizButton&quot;].exists)<br>}</pre><p>Simple test.</p><p>But extremely important for framework health checks.</p><h3>2. Dynamic Question Navigation</h3><p>This is where things became interesting.</p><p>The framework validates:</p><ul><li>question transitions</li><li>disabled/enabled button states</li><li>quiz progression logic</li><li>navigation synchronization</li></ul><p>Real apps constantly change state during user interaction.</p><p>Testing these transitions helped simulate production-level UI automation behavior.</p><h3>3. Timer-Based UI Synchronization</h3><p>Each question includes timer logic.</p><p>This introduced asynchronous UI behavior, which is one of the biggest sources of flaky automation.</p><p>Initially, fixed waits caused instability.</p><p>Bad approach:</p><pre>sleep(5)</pre><p>Better approach:</p><pre>XCTAssertTrue(element.waitForExistence(timeout: 5))</pre><p>This improved:</p><ul><li>execution speed</li><li>test reliability</li><li>synchronization stability</li></ul><p>One of the biggest lessons in XCUITest:</p><blockquote><em>Smart waits matter more than long waits.</em></blockquote><h3>4. Keyboard Handling Issues</h3><p>One problem that surprised me during iOS automation was keyboard behavior.</p><p>Sometimes:</p><ul><li>the keyboard blocked buttons</li><li>scrolling failed</li><li>typing became inconsistent</li></ul><p>This created flaky tests during search and form interactions.</p><p>To fix this:</p><ul><li>keyboard dismissal helpers were added</li><li>scrolling strategies were improved</li><li>interaction waits were optimized</li></ul><p>Mobile automation behaves very differently compared to web automation.</p><h3>5. Flaky Element Interactions</h3><p>One of the hardest issues involved SwiftUI-style wrapped interactions.</p><p>Sometimes:</p><ul><li>elements were visible</li><li>accessibility existed</li><li>but taps still failed</li></ul><p>The actual problem?</p><p>The visible UI was not always the tappable hierarchy.</p><p>This is where I discovered one of the most useful debugging techniques in XCUITest:</p><pre>po XCUIApplication()</pre><p>This prints the entire accessibility hierarchy.</p><p>Once I started debugging through hierarchy inspection instead of visual assumptions, locator stability improved significantly.</p><p>That changed how I approached iOS automation completely.</p><h3>Building a Scalable Framework</h3><p>At first, the goal was simple:</p><blockquote><em>Make the tests pass.</em></blockquote><p>But later, the focus shifted toward:</p><ul><li>maintainability</li><li>readability</li><li>scalability</li></ul><p>So the framework evolved into:</p><ul><li>reusable helpers</li><li>centralized waits</li><li>shared constants</li><li>Page Object Model structure</li><li>cleaner assertions</li></ul><h3>Applying Page Object Model (POM)</h3><p>As test coverage increased, maintaining raw locators inside tests became messy.</p><p>So I moved toward Page Object Model architecture.</p><p>Benefits included:</p><ul><li>reusable screen actions</li><li>centralized locators</li><li>cleaner test flows</li><li>easier debugging</li></ul><p>Example structure:</p><pre>Pages/<br>├── HomePage.swift<br>├── QuizPage.swift<br>├── ResultPage.swift</pre><p>This made the framework easier to extend with new scenarios.</p><h3>How AI Helped During Development</h3><p>AI tools played a major role during this project.</p><p>But not in the way people usually think.</p><p>AI did NOT:</p><ul><li>magically build the framework</li><li>replace automation knowledge</li><li>fix everything automatically</li></ul><p>Instead, AI helped accelerate:</p><ul><li>debugging</li><li>understanding unfamiliar iOS behavior</li><li>improving architecture</li><li>generating boilerplate code</li><li>fixing repetitive issues</li></ul><p>The biggest lesson?</p><blockquote><em>Strong automation fundamentals matter more than knowing a specific language.</em></blockquote><p>Because if you understand:</p><ul><li>waits</li><li>locators</li><li>framework structure</li><li>flaky behavior</li><li>assertions</li><li>synchronization</li></ul><p>You can adapt to almost any automation stack much faster.</p><p>That was exactly my experience moving into XCUITest.</p><h3>Lessons Learned from Building UITestify</h3><h3>1. Accessibility Is Everything</h3><p>Good accessibility identifiers make automation stable.</p><p>Poor accessibility creates flaky tests.</p><h3>2. Mobile Automation Is Different</h3><p>Keyboard handling, scrolling, synchronization, and gestures behave very differently compared to web automation.</p><h3>3. Environment Setup Takes Time</h3><p>Simulator configuration and Xcode setup can easily take longer than writing actual test cases.</p><h3>4. Flaky Tests Usually Come from Synchronization</h3><p>Most instability came from:</p><ul><li>improper waits</li><li>dynamic UI updates</li><li>interaction timing</li></ul><p>Not from XCTest itself.</p><h3>5. Framework Design Matters Early</h3><p>Even small projects become difficult to maintain without:</p><ul><li>reusable helpers</li><li>proper structure</li><li>consistent naming</li><li>centralized logic</li></ul><h3>Why This Project Matters for Beginners</h3><p>If you’re learning iOS automation, UITestify gives you practical exposure to:</p><ul><li>XCUITest fundamentals</li><li>UI synchronization</li><li>accessibility debugging</li><li>scalable test design</li><li>mobile-specific automation challenges</li></ul><p>Unlike basic demo apps, this project simulates real-world automation behavior while still staying beginner friendly.</p><h3>Future Improvements</h3><p>Planned enhancements include:</p><ul><li>CI/CD integration</li><li>GitHub Actions execution</li><li>advanced reporting</li><li>screenshot attachments</li><li>data-driven testing</li><li>parallel execution</li><li>deeper Page Object abstraction</li><li>network mocking support</li></ul><p>The long-term goal is to evolve UITestify into a production-style mobile automation learning framework.</p><h3>Final Thoughts</h3><p>Learning a new automation stack used to feel overwhelming.</p><p>Today, with strong fundamentals and the right tools, the learning curve is much faster.</p><p>Building UITestify taught me:</p><ul><li>how XCUITest works internally</li><li>how accessibility impacts automation</li><li>how mobile synchronization differs from web testing</li><li>and how important framework design is from day one</li></ul><p>Most importantly, it reinforced one thing:</p><blockquote><em>Automation skills are transferable.</em></blockquote><p>Once you truly understand testing fundamentals, adapting to new platforms becomes much easier.</p><p>If you want to explore iOS automation or improve your XCUITest skills, feel free to check out the project:</p><h3>🔗 Resources</h3><ul><li>UITestify-iOS — <a href="https://github.com/codedbyaman/UiTestify-iOS">https://github.com/codedbyaman/UiTestify-iOS</a></li></ul><p>Happy Testing 🚀</p><h3>🚀 Quick XCUITest Hacks &amp; Tips</h3><ul><li>Use launchArguments to skip onboarding, disable animations, or create test mode.</li><li>Prefer waitForExistence() over sleep() for stable automation.</li><li>Use firstMatch for faster and more reliable locators.</li><li>Disable animations to reduce flaky test failures.</li><li>Use po XCUIApplication() or print(app.debugDescription) to inspect the full UI hierarchy.</li><li>Use <strong>Accessibility Inspector</strong> to find stable accessibility identifiers.</li><li>Use Xcode’s <strong>Record UI Test</strong> feature for quick starter flows.</li><li>Capture screenshots automatically on failures for easier debugging.</li><li>Use addUIInterruptionMonitor to handle permission popups.</li><li>Use coordinate tap when normal tap fails on complex UI elements.</li><li>Keep accessibility IDs clean and readable like startQuizButton.</li><li>Separate test data from test logic for better maintainability.</li><li>Run flaky tests individually first before rerunning the full suite.</li><li>Always validate tests in slower CI environments too.</li><li>Treat automation like software engineering, not just test scripts.</li></ul><h3>🚀 Beginner-Friendly XCUITest Hacks &amp; Tips</h3><h4>Launch the App</h4><pre>let app = XCUIApplication()<br>app.launch()</pre><h4>Tap on a Button</h4><pre>app.buttons[&quot;Login&quot;].tap()</pre><h4>Enter Text in a TextField</h4><pre>app.textFields[&quot;Email&quot;].tap()<br>app.textFields[&quot;Email&quot;].typeText(&quot;test@gmail.com&quot;)</pre><h4>Wait for Element to Appear</h4><pre>XCTAssertTrue(<br>    app.buttons[&quot;Continue&quot;]<br>        .waitForExistence(timeout: 5)<br>)</pre><h4>Check If Element Exists</h4><pre>XCTAssertTrue(app.staticTexts[&quot;Welcome&quot;].exists)</pre><h4>Scroll the Screen</h4><pre>app.swipeUp()</pre><h4>Handle Keyboard</h4><pre>if app.keyboards.count &gt; 0 {<br>    app.buttons[&quot;Done&quot;].tap()<br>}</pre><h4>Use Accessibility Identifier</h4><pre>loginButton.accessibilityIdentifier = &quot;loginButton&quot;</pre><p>Use in test:</p><pre>app.buttons[&quot;loginButton&quot;].tap()</pre><h4>Print Full UI Hierarchy</h4><pre>print(app.debugDescription)</pre><h4>Debug Accessibility Tree</h4><pre>po XCUIApplication()</pre><h4>Use firstMatch</h4><pre>app.buttons[&quot;Continue&quot;].firstMatch.tap()</pre><h4>Capture Screenshot</h4><pre>let screenshot = XCUIScreen.main.screenshot()</pre><h4>Handle Permission Popup</h4><pre>addUIInterruptionMonitor(withDescription: &quot;Permission&quot;) { alert in<br>    alert.buttons[&quot;Allow&quot;].tap()<br>    return true<br>}</pre><h4>Coordinate Tap</h4><pre>element.coordinate(<br>    withNormalizedOffset: CGVector(dx: 0.5, dy: 0.5)<br>).tap()</pre><h4>Reset Simulator</h4><pre>xcrun simctl erase all</pre><h4>Use Smart Waits Instead of sleep()</h4><pre>// ❌ Avoid<br>sleep(5)</pre><pre>// ✅ Better<br>element.waitForExistence(timeout: 5)</pre><blockquote><em>Stable accessibility + smart waits + clean framework design = reliable iOS automation 🚀</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce63a29101e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>