<?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 Alijah Mancera on Medium]]></title>
        <description><![CDATA[Stories by Alijah Mancera on Medium]]></description>
        <link>https://medium.com/@alijah.mancera?source=rss-218398dca49b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6b8sfMUmX_h8nHTI</url>
            <title>Stories by Alijah Mancera on Medium</title>
            <link>https://medium.com/@alijah.mancera?source=rss-218398dca49b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 09:12:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alijah.mancera/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[Enhancing Mobile Test Automation Capabilities with AWS Device Farm]]></title>
            <link>https://medium.com/wealthpark-engineering/enhancing-mobile-test-automation-capabilities-with-aws-device-farm-0cced165fc05?source=rss-218398dca49b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0cced165fc05</guid>
            <category><![CDATA[gitlab-ci-cd]]></category>
            <category><![CDATA[appium]]></category>
            <category><![CDATA[mobile-automation-testing]]></category>
            <category><![CDATA[aws-device-farm]]></category>
            <dc:creator><![CDATA[Alijah Mancera]]></dc:creator>
            <pubDate>Tue, 25 Feb 2025 16:49:19 GMT</pubDate>
            <atom:updated>2025-03-07T08:18:22.838Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ojKG4g61J_5tT_K6KIJnGQ.jpeg" /></figure><p>In the continuously changing mobile application world, ensuring rigorous and efficient testing processes is critical to preserving app quality and customer satisfaction. We looked into the transformative possibilities of incorporating <a href="https://aws.amazon.com/device-farm/">AWS Device Farm</a> into our mobile testing strategy. This allows developers and QA teams to run automated tests on a variety of real-world devices. We will look at how using this tool can helped us speed the testing process and improve test coverage by allowing access to a variety of device and OS combinations.</p><h3><strong>Why AWS Device Farm?</strong></h3><p>Three important points that fulfills our requirements:</p><ul><li><a href="https://awsdevicefarm.info/">Real Device Testing</a></li><li><a href="https://aws.amazon.com/device-farm/pricing/">Cost Effective</a></li><li><a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html">Remote Access</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ks5ObnzxCASm5zYnviW5gA.png" /><figcaption>Diagram A</figcaption></figure><h3><strong>Appium and AWS Device Farm: The Ultimate Mobile Testing Tandem</strong></h3><p><strong><em>Appium</em>, </strong>a super popular open-source framework just like <strong><em>Selenium</em></strong>, automates mobile apps on both Android and iOS.</p><p>Appium uses the <a href="https://github.com/appium/appium-base-driver/blob/master/docs/mjsonwp/protocol-methods.md#mobile-json-wire-protocol-endpoints"><em>Mobile JSON Wire Protocol</em></a>, which is like the <a href="https://www.selenium.dev/documentation/legacy/json_wire_protocol/"><em>JSON Wire Protocol</em></a> used by Selenium. This allows for a seamless transition to mobile testing without the steep learning curve that often accompanies new tools.</p><h3>Setting up the pipeline</h3><blockquote><a href="https://docs.gitlab.com/ci/yaml/#global-keywords">Global YAML keywords</a> that control the overall behavior of the project’s pipelines.</blockquote><blockquote><a href="https://docs.gitlab.com/ci/jobs/">Jobs</a> that execute commands to accomplish a task. For example, a job could compile, test, or deploy code. Jobs run independently from each other, and are executed by <a href="https://docs.gitlab.com/ci/runners/">runners</a>.</blockquote><blockquote>Stages, which define how to group jobs together. Stages run in sequence, while the jobs in a stage run in parallel. For example, an early stage could have jobs that lint and compile code, while later stages could have jobs that test and deploy code. If all jobs in a stage succeed, the pipeline moves on to the next stage. If any job in a stage fails, the next stage is not (usually) executed and the pipeline ends early.</blockquote><blockquote>~ <a href="https://docs.gitlab.com/ci/pipelines/">https://docs.gitlab.com/ci/pipelines/</a></blockquote><p>Define the CI/CD pipeline in your GitLab.gitlab-ci.yml file.</p><p><em>Example of possible stages based on Diagram A:</em></p><pre>stages:<br>  - build<br>  - upload<br>  - test</pre><h4>build stage</h4><p>Create a package of the automation framework containing the test scripts.</p><pre>example_build:<br>  stage: build<br>  script:<br>    - mvn clean package -DskipTests</pre><h4>upload stage</h4><p>Upload both the app (.apk/.ipa) and the created package to AWS Device Farm. You can read more of <em>create-upload</em> <a href="https://docs.aws.amazon.com/cli/latest/reference/devicefarm/create-upload.html">here</a>.</p><pre>example_upload_app:<br>  stage: upload<br>  script:<br>    - aws devicefarm create-upload --project-arn &quot;project_arn_here&quot; --name app.apk --type ANDROID_APP<br><br>example_upload_package:<br>  stage: upload<br>  script: <br>    - aws devicefarm create-upload --project-arn &quot;project_arn_here&quot; --name &quot;package.zip&quot; --type &quot;APPIUM_JAVA_TESTNG_TEST_PACKAGE&quot;</pre><h4>test stage</h4><p>This is where you can instruct AWS Device Farm to run the script from the uploaded package against the uploaded mobile app. A test spec file is needed to define custom test environments for complete control over the automated tests.</p><pre>example_test_app:<br>  stage: test<br>  script:<br>    - test_spec_here</pre><p>Here is an example of a test spec file provided by <a href="https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environment-example.html">AWS</a> itself:</p><pre>version: 0.1<br><br># This flag enables your test to run using Device Farm&#39;s Amazon Linux 2 test host when scheduled on<br># Android devices. By default, iOS device tests will always run on Device Farm&#39;s macOS test hosts.<br># For Android, you can explicitly select your test host to use our Amazon Linux 2 infrastructure.<br># For more information, please see:<br># https://docs.aws.amazon.com/devicefarm/latest/developerguide/amazon-linux-2.html<br>android_test_host: amazon_linux_2<br><br># Phases represent collections of commands that are executed during your test run on the test host.<br>phases:<br><br>  # The install phase contains commands for installing dependencies to run your tests.<br>  # For your convenience, certain dependencies are preinstalled on the test host. <br><br>  # For Android tests running on the Amazon Linux 2 test host, many software libraries are available<br>  # from the test host using the devicefarm-cli tool. To learn more, please see:<br>  # https://docs.aws.amazon.com/devicefarm/latest/developerguide/amazon-linux-2-devicefarm-cli.html<br><br>  # For iOS tests, you can use the Node.JS tools nvm, npm, and avm to setup your environment. By<br>  # default, Node.js versions 16.20.2 and 14.19.3 are available on the test host.<br>  install:<br>    commands:<br>      # The Appium server is written using Node.js. In order to run your desired version of Appium,<br>      # you first need to set up a Node.js environment that is compatible with your version of Appium.<br>      - |-<br>        if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = &quot;Android&quot; ];<br>        then<br>          devicefarm-cli use node 16;<br>        else<br>          # For iOS, use &quot;nvm use&quot; to switch between the two preinstalled NodeJS versions 14 and 16,<br>          # and use &quot;nvm install&quot; to download a new version of your choice.<br>          nvm use 16;<br>        fi;<br>      - node --version<br><br>      # Use the devicefarm-cli to select a preinstalled major version of Appium on Android.<br>      # Use avm or npm to select Appium for iOS.<br>      - |-<br>        if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = &quot;Android&quot; ];<br>        then<br>          # For Android, the Device Farm service automatically updates the preinstalled Appium versions<br>          # over time to incorporate the latest minor and patch versions for each major version. If you<br>          # wish to select a specific version of Appium, you can instead use NPM to install it:<br>          # npm install -g appium@2.1.3;<br>          devicefarm-cli use appium 2;<br>        else<br>          # For iOS, Appium versions 1.22.2 and 2.2.1 are preinstalled and selectable through avm.<br>          # For all other versions, please use npm to install them. For example:<br>          # npm install -g appium@2.1.3;<br>          # Note that, for iOS devices, Appium 2 is only supported on iOS version 14 and above using<br>          # NodeJS version 16 and above.<br>          avm 2.2.1;<br>        fi;<br>      - appium --version<br><br>      # For Appium version 2, for Android tests, Device Farm automatically updates the preinstalled<br>      # UIAutomator2 driver over time to incorporate the latest minor and patch versions for its major<br>      # version 2. If you want to install a specific version of the driver, you can use the Appium<br>      # extension CLI to uninstall the existing UIAutomator2 driver and install your desired version:<br>      # - |-<br>      #   if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = &quot;Android&quot; ];<br>      #   then<br>      #     appium driver uninstall uiautomator2;<br>      #     appium driver install uiautomator2@2.34.0;<br>      #   fi;<br><br>      # For Appium version 2, for iOS tests, the XCUITest driver is preinstalled using version 5.7.0<br>      # If you want to install a different version of the driver, you can use the Appium extension CLI<br>      # to uninstall the existing XCUITest driver and install your desired version:<br>      # - |-<br>      #   if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = &quot;iOS&quot; ];<br>      #   then<br>      #     appium driver uninstall xcuitest;<br>      #     appium driver install xcuitest@5.8.1;<br>      #   fi;<br><br>      # We recommend setting the Appium server&#39;s base path explicitly for accepting commands.<br>      - export APPIUM_BASE_PATH=/wd/hub<br><br>      # Install the NodeJS dependencies.<br>      - cd $DEVICEFARM_TEST_PACKAGE_PATH<br>      # First, install dependencies which were packaged with the test package using npm-bundle.<br>      - npm install *.tgz<br>      # Then, optionally, install any additional dependencies using npm install.<br>      # If you do run these commands, we strongly recommend that you include your package-lock.json<br>      # file with your test package so that the dependencies installed on Device Farm match<br>      # the dependencies you&#39;ve installed locally.<br>      # - cd node_modules/*<br>      # - npm install<br><br>  # The pre-test phase contains commands for setting up your test environment.<br>  pre_test:<br>    commands:<br>      # Device farm provides different pre-built versions of WebDriverAgent, an essential Appium<br>      # dependency for iOS devices, and each version is suggested for different versions of Appium:<br>      # DEVICEFARM_WDA_DERIVED_DATA_PATH_V8: this version is suggested for Appium 2<br>      # DEVICEFARM_WDA_DERIVED_DATA_PATH_V7: this version is suggested for Appium 1<br>      # Additionally, for iOS versions 16 and below, the device unique identifier (UDID) needs<br>      # to be slightly modified for Appium tests.<br>      - |-<br>        if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = &quot;iOS&quot; ];<br>        then<br>          if [ $(appium --version | cut -d &quot;.&quot; -f1) -ge 2 ];<br>          then<br>            DEVICEFARM_WDA_DERIVED_DATA_PATH=$DEVICEFARM_WDA_DERIVED_DATA_PATH_V8;<br>          else<br>            DEVICEFARM_WDA_DERIVED_DATA_PATH=$DEVICEFARM_WDA_DERIVED_DATA_PATH_V7;<br>          fi;<br>          <br>          if [ $(echo $DEVICEFARM_DEVICE_OS_VERSION | cut -d &quot;.&quot; -f 1) -le 16 ];<br>          then<br>            DEVICEFARM_DEVICE_UDID_FOR_APPIUM=$(echo $DEVICEFARM_DEVICE_UDID | tr -d &quot;-&quot;);<br>          else<br>            DEVICEFARM_DEVICE_UDID_FOR_APPIUM=$DEVICEFARM_DEVICE_UDID;<br>          fi;<br>        fi;<br><br>      # Appium downloads Chromedriver using a feature that is considered insecure for multitenant<br>      # environments. This is not a problem for Device Farm because each test host is allocated<br>      # exclusively for one customer, then terminated entirely. For more information, please see<br>      # https://github.com/appium/appium/blob/master/packages/appium/docs/en/guides/security.md<br><br>      # We recommend starting the Appium server process in the background using the command below.<br>      # The Appium server log will be written to the $DEVICEFARM_LOG_DIR directory.<br>      # The environment variables passed as capabilities to the server will be automatically assigned<br>      # during your test run based on your test&#39;s specific device.<br>      # For more information about which environment variables are set and how they&#39;re set, please see<br>      # https://docs.aws.amazon.com/devicefarm/latest/developerguide/custom-test-environment-variables.html<br>      - |-<br>        if [ $DEVICEFARM_DEVICE_PLATFORM_NAME = &quot;Android&quot; ];<br>        then<br>          appium --base-path=$APPIUM_BASE_PATH --log-timestamp \<br>            --log-no-colors --relaxed-security --default-capabilities \<br>            &quot;{\&quot;appium:deviceName\&quot;: \&quot;$DEVICEFARM_DEVICE_NAME\&quot;, \<br>            \&quot;platformName\&quot;: \&quot;$DEVICEFARM_DEVICE_PLATFORM_NAME\&quot;, \<br>            \&quot;appium:app\&quot;: \&quot;$DEVICEFARM_APP_PATH\&quot;, \<br>            \&quot;appium:udid\&quot;:\&quot;$DEVICEFARM_DEVICE_UDID\&quot;, \<br>            \&quot;appium:platformVersion\&quot;: \&quot;$DEVICEFARM_DEVICE_OS_VERSION\&quot;, \<br>            \&quot;appium:chromedriverExecutableDir\&quot;: \&quot;$DEVICEFARM_CHROMEDRIVER_EXECUTABLE_DIR\&quot;, \<br>            \&quot;appium:automationName\&quot;: \&quot;UiAutomator2\&quot;}&quot; \<br>            &gt;&gt; $DEVICEFARM_LOG_DIR/appium.log 2&gt;&amp;1 &amp;<br>        else<br>          appium --base-path=$APPIUM_BASE_PATH --log-timestamp \<br>            --log-no-colors --relaxed-security --default-capabilities \<br>            &quot;{\&quot;appium:deviceName\&quot;: \&quot;$DEVICEFARM_DEVICE_NAME\&quot;, \<br>            \&quot;platformName\&quot;: \&quot;$DEVICEFARM_DEVICE_PLATFORM_NAME\&quot;, \<br>            \&quot;appium:app\&quot;: \&quot;$DEVICEFARM_APP_PATH\&quot;, \<br>            \&quot;appium:udid\&quot;:\&quot;$DEVICEFARM_DEVICE_UDID_FOR_APPIUM\&quot;, \<br>            \&quot;appium:platformVersion\&quot;: \&quot;$DEVICEFARM_DEVICE_OS_VERSION\&quot;, \<br>            \&quot;appium:derivedDataPath\&quot;: \&quot;$DEVICEFARM_WDA_DERIVED_DATA_PATH\&quot;, \<br>            \&quot;appium:usePrebuiltWDA\&quot;: true, \<br>            \&quot;appium:automationName\&quot;: \&quot;XCUITest\&quot;}&quot; \<br>            &gt;&gt; $DEVICEFARM_LOG_DIR/appium.log 2&gt;&amp;1 &amp;<br>        fi;<br><br>      # This code will wait until the Appium server starts.<br>      - |-<br>        appium_initialization_time=0;<br>        until curl --silent --fail &quot;http://0.0.0.0:4723${APPIUM_BASE_PATH}/status&quot;; do<br>          if [[ $appium_initialization_time -gt 30 ]]; then<br>            echo &quot;Appium did not start within 30 seconds. Exiting...&quot;;<br>            exit 1;<br>          fi;<br>          appium_initialization_time=$((appium_initialization_time + 1));<br>          echo &quot;Waiting for Appium to start on port 4723...&quot;;<br>          sleep 1;<br>        done;<br><br>  # The test phase contains commands for running your tests.<br>  test:<br>    commands:<br>      # Your test package is downloaded and unpackaged into the $DEVICEFARM_TEST_PACKAGE_PATH directory.<br>      # When compiling with npm-bundle, the test folder can be found in the node_modules/*/ subdirectory.<br>      - cd $DEVICEFARM_TEST_PACKAGE_PATH/node_modules/*<br>      - echo &quot;Starting the Appium NodeJS test&quot;<br>      <br>      # Enter your command below to start the tests. The command should be the same command as the one <br>      # you use to run your tests locally from the command line. An example, &quot;npm test&quot;, is given below:<br>      - npm test<br><br>  # The post-test phase contains commands that are run after your tests have completed.<br>  # If you need to run any commands to generating logs and reports on how your test performed,<br>  # we recommend adding them to this section.<br>  post_test:<br>    commands:<br><br># Artifacts are a list of paths on the filesystem where you can store test output and reports.<br># All files in these paths will be collected by Device Farm.<br># These files will be available through the ListArtifacts API as your &quot;Customer Artifacts&quot;.<br>artifacts:<br>  # By default, Device Farm will collect your artifacts from the $DEVICEFARM_LOG_DIR directory.<br>  - $DEVICEFARM_LOG_DIR</pre><h3>Conclusion</h3><p>Integrating Gitlab CI/CD, Appium, and AWS Device Farm you can build a scalable, maintainable, and cost effective solution for you Mobile Test Automation.</p><p>Don’t waste your beautiful pipeline, go write an effective test automation script 😉</p><p><strong>Possible next steps for your project or take it as recommendation:</strong></p><p>1. Configure GitLab CI/CD by your flavour.</p><p>2. Set up your desired mobile devices.</p><p>3. Test and refine the pipeline as you go.</p><p>4. Notification for your team about the result!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0cced165fc05" width="1" height="1" alt=""><hr><p><a href="https://medium.com/wealthpark-engineering/enhancing-mobile-test-automation-capabilities-with-aws-device-farm-0cced165fc05">Enhancing Mobile Test Automation Capabilities with AWS Device Farm</a> was originally published in <a href="https://medium.com/wealthpark-engineering">WealthPark Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>