<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Jochen</title>
    <description>The latest articles on Forem by Jochen (@testingb0t).</description>
    <link>https://forem.com/testingb0t</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F213719%2F2678ef6d-0c4d-41da-b4b2-96c8bac889c0.jpeg</url>
      <title>Forem: Jochen</title>
      <link>https://forem.com/testingb0t</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/testingb0t"/>
    <language>en</language>
    <item>
      <title>Optimising Appium Tests</title>
      <dc:creator>Jochen</dc:creator>
      <pubDate>Sat, 28 May 2022 07:31:49 +0000</pubDate>
      <link>https://forem.com/testingb0t/optimising-appium-tests-1jfk</link>
      <guid>https://forem.com/testingb0t/optimising-appium-tests-1jfk</guid>
      <description>&lt;p&gt;Let's first begin by recapping what Appium is, what it does and why it is used by developers and QA for both mobile web testing and mobile app testing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Appium?
&lt;/h2&gt;

&lt;p&gt;Appium is an open-source framework, built in Javascript, which provides a collection of tools allowing you to run automated tests on mobile simulators/emulators and physical mobile devices.&lt;/p&gt;

&lt;p&gt;Automated tests are test scripts which perform various actions on a website, or mobile app, while checking if the result of those actions are the intended result.&lt;/p&gt;

&lt;p&gt;Both website and mobile app developers, as well as QA departments, use automated testing as a way to find regression bugs or incompatibilities on various devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  How do I use Appium?
&lt;/h2&gt;

&lt;p&gt;You can easily set up Appium if you have already installed NodeJS. To install, simply run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i appium
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, make sure you have either an iOS simulator or Android emulator installed on the same system. You can also connect a physical device to the machine, through USB, which should work just as well with Appium.&lt;/p&gt;

&lt;p&gt;Once setup, you can write your first Appium test. In this example, let's use WebDriverIO:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install webdriverio
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, copy/paste the example code below to run your first test:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const opts = {
  path: '/wd/hub',
  port: 4723,
  capabilities: {
    platformName: "Android",
    platformVersion: "12",
    deviceName: "Android Emulator",
    app: "https://github.com/appium/appium/raw/master/sample-code/apps/ApiDemos-debug.apk",
    appPackage: "io.appium.android.apis",
    appActivity: ".view.TextFields",
    automationName: "UiAutomator2"
  }
};

async function main () {
  const client = await wdio.remote(opts);
  const field = await client.$("android.widget.EditText");
  await field.setValue("Hello World!");
  const value = await field.getText();
  assert.strictEqual(value, "Hello World!");
  await client.deleteSession();
}

main();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will start an automated test session on an Android 12 emulator, running on your machine. It will open a demo app, input 'Hello World' in an input field and check if the input was successful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optimising Appium Tests
&lt;/h2&gt;

&lt;p&gt;Appium provides various options, out of the box, that make testing as stable as possible on various devices.&lt;/p&gt;

&lt;p&gt;There are some settings you can tweak, to &lt;a href="https://testingbot.com/resources/articles/getting-started-with-appium"&gt;make Appium more performant&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These settings depend on wether you want to run tests on Android or iOS. Let's see a list of settings we can modify to make Appium faster:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cross Platform Capabilities&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;noReset: By default Appium will reset as much as possible in between sessions. If you do not want this, setting this to &lt;code&gt;false&lt;/code&gt; will speed up test execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;fullReset: Only use this if you really have to. Usually not required&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;isHeadless: Setting this to &lt;code&gt;true&lt;/code&gt; will start a simulator or emulator without an UI. This should be faster.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Android Capabilities&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;autoGrantPermission: Setting this capability to &lt;code&gt;true&lt;/code&gt; allows Appium to determine your app permissions and grant them at the start of the test.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;appWaitPackage / appWaitActivity: Indicate to Appium which activity is supposed to start. This prevents having to wait for Appium to inspect the &lt;code&gt;apk&lt;/code&gt; and loop over activities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;skipUnlock: Appium uses a helper tool to check if the device or emulator under test is locked, for example with a pin code. If this is not the case, skipping this will shave off a few seconds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;skipDeviceInitialization: Setting this to &lt;code&gt;true&lt;/code&gt; will cause Appium not to install the &lt;code&gt;io.appium.settings&lt;/code&gt; helper app.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;skipServerInstallation: If the server app is already on the device, skipping this will shave off a second or so.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;iOS Capabilities&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;iosInstallPause: Let Appium know how long to wait before starting the test.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;maxTypingFrequency: This capability specifies the maximum speed when typing on an iOS device or simulator.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;realDeviceScreenshotter: This will use the &lt;code&gt;idevicescreenshot&lt;/code&gt; program, which is part of &lt;code&gt;libimobiledevice&lt;/code&gt;, to capture screenshots. It should be more performant.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;simpleIsVisibleCheck: This will use a simpler visible check than the default one used by WebDriverAgent.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Appium Cloud Testing
&lt;/h2&gt;

&lt;p&gt;Once you want to run Appium automated tests on multiple devices, you might want to consider using a cloud provider. The advantage of this is that these provide multiple physical devices, iOS and Android, which are already preconfigured and ready to run your tests.&lt;/p&gt;

&lt;p&gt;You will get instant test results, including a video, screenshots and logs. &lt;a href="https://testingbot.com"&gt;TestingBot&lt;/a&gt; is an Appium cloud provider which offers access to physical Android and iOS devices for native mobile app testing.&lt;/p&gt;

</description>
      <category>appium</category>
      <category>testing</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Visual Regression Testing with Playwright</title>
      <dc:creator>Jochen</dc:creator>
      <pubDate>Mon, 20 Sep 2021 12:12:25 +0000</pubDate>
      <link>https://forem.com/testingb0t/visual-regression-testing-with-playwright-53mp</link>
      <guid>https://forem.com/testingb0t/visual-regression-testing-with-playwright-53mp</guid>
      <description>&lt;h2&gt;
  
  
  What is Playwright?
&lt;/h2&gt;

&lt;p&gt;Playwright is a NodeJS library, created by Microsoft, which offers very similar features to Puppeteer. Both libraries allow you to automate actions within a browser.&lt;/p&gt;

&lt;p&gt;With Playwright, you can start or connect to a Chrome, Edge, Safari or Firefox browser and send commands back and forth. The protocol used for these messages is the DevTools protocol (for Chromium browsers) and a custom protocol for Firefox and WebKit browsers.&lt;/p&gt;

&lt;p&gt;The main advantage of using Playwright instead of Puppeteer is that Playwright supports multiple browser vendors, where as Puppeteer only supports Chromium based browsers.&lt;/p&gt;

&lt;h2&gt;
  
  
  How can I use Playwright to do automated testing?
&lt;/h2&gt;

&lt;p&gt;One of the use-cases in using a browser automation framework, is to use it with a testing framework. Popular testing frameworks, such as &lt;a href="https://testingbot.com/support/playwright/jest.html"&gt;Jest&lt;/a&gt; and &lt;a href="https://testingbot.com/support/playwright/mocha.html"&gt;Mocha&lt;/a&gt;, already implement support for Playwright testing.&lt;/p&gt;

&lt;p&gt;These test frameworks allow you to start or connect to a browser and perform the actions defined within your test cases.&lt;/p&gt;

&lt;p&gt;An important thing to keep in mind is that Playwright will run in a headless-mode by default. This means that the UI of the browser will not be visible to the user. While running your automated tests, you will not see the browser perform these actions. Headless mode is used to speed up the Playwright execution: it reduces CPU usage because no UI updates are required and improves the speed of total execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Visual Regression Testing?
&lt;/h2&gt;

&lt;p&gt;Visual Regression Testing is used to prevent unintentional changes to an application's visual state. Let's say you have a website and you know how the page should look like. You instruct your test framework to take a screenshot of your pixel-perfect page, and tell the framework that the page should always look identical to the screenshot you just took.&lt;/p&gt;

&lt;p&gt;In a perfect world, your webpage will always look perfect to the end user, just like the screenshot you took. However, sometimes an update to your website, by a developer or someone else in your team, might cause a (visual) bug. This could be a DOM element missing on your page, or a CSS change that causes rendering issues, or any other bug resulting in an inferior experience to the website visitor.&lt;/p&gt;

&lt;p&gt;This is where the power of Visual Regression Testing shines: it will alert you when an unintended change occurs on your website and causes a visual bug.&lt;/p&gt;

&lt;h2&gt;
  
  
  Visual Testing Libraries
&lt;/h2&gt;

&lt;p&gt;There are quite some libraries available online, open-sourced and other licensed visual comparison libraries, that help you to set up and perform regression testing.&lt;/p&gt;

&lt;p&gt;Popular libraries such as &lt;a href="https://github.com/garris/BackstopJS"&gt;BackstopJS&lt;/a&gt; for Puppeteer, or &lt;a href="https://github.com/oblador/loki"&gt;Loki&lt;/a&gt; provides developers and QA with powerful techniques to quickly, and easily, set up visual regression testing.&lt;/p&gt;

&lt;p&gt;In the case of &lt;a href="https://testingbot.com/support/playwright"&gt;Playwright testing&lt;/a&gt;, Playwright Test provides a built-in &lt;a href="https://playwright.dev/docs/test-snapshots/"&gt;Visual Comparison&lt;/a&gt; feature to take, and visually compare, screenshots with Playwright.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure Visual Comparison Testing with Playwright
&lt;/h2&gt;

&lt;p&gt;Playwright contains a package called Playwright Test, which is built as an utility to run automated tests with Playwright.&lt;/p&gt;

&lt;p&gt;When you first run a test, Playwright Test will take a screenshot of the page, a baseline screenshot (or golden image), and save it in a folder.&lt;/p&gt;

&lt;p&gt;Subsequent tests will continue to take screenshots and match these, pixel-by-pixel, with the baseline screenshot.&lt;br&gt;
Let's say you saved your golden image as &lt;code&gt;golden.png&lt;/code&gt;, a simple assertion would be to use this syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;screenshot&lt;/span&gt;&lt;span class="p"&gt;()).&lt;/span&gt;&lt;span class="nx"&gt;toMatchSnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;golden.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where &lt;code&gt;page&lt;/code&gt; is an object provided by Playwright Test, trying to match the output of &lt;code&gt;page.screenshot()&lt;/code&gt; with the contents of &lt;code&gt;golden.png&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;When a test fails, meaning the page has changed its contents, you will receive a test error, indicating the screenshot no longer matches the golden image.&lt;/p&gt;

&lt;p&gt;Internally, Playwright Test uses the &lt;a href="https://github.com/mapbox/pixelmatch"&gt;pixelmatch&lt;/a&gt; library to compare screenshots for visual differences. It is possible to pass several options to this library, to fine-tune the comparison of images. The most important option is the &lt;code&gt;threshold&lt;/code&gt; option, which indicates the threshold amount of differences allowed between two images.&lt;/p&gt;

&lt;p&gt;A full example of a test case using Visual Comparison Testing  :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// example.spec.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@playwright/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;example test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://testingbot.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;screenshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.hero&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;toMatchSnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hero.png&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Comparing binary or text formats
&lt;/h2&gt;

&lt;p&gt;Next to visual comparison of images, Playwright Test is also capable of comparing texts and binary outputs.&lt;/p&gt;

&lt;p&gt;Let's say for example that you want to make sure your DOM element keeps using the same text content. A simple way to do this is to snapshot the contents of the DOM element and compare it in later runs with the golden snapshot:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// example.spec.js&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;expect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@playwright/test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;example test&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;goto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;https://testingbot.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textContent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;.login&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;toMatchSnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;login.txt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Playwright Test gives you a basic, but powerful way to (visually) compare webpages. Give it a try - more information available on the &lt;a href="https://playwright.dev/docs/test-snapshots/"&gt;Playwright Test Documentation page&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>automatedtesting</category>
      <category>selenium</category>
      <category>chrome</category>
    </item>
    <item>
      <title>Setting up your own Mobile Device Lab</title>
      <dc:creator>Jochen</dc:creator>
      <pubDate>Sat, 31 Aug 2019 09:31:10 +0000</pubDate>
      <link>https://forem.com/testingbot/setting-up-your-own-mobile-device-lab-5f86</link>
      <guid>https://forem.com/testingbot/setting-up-your-own-mobile-device-lab-5f86</guid>
      <description>&lt;p&gt;As a developer, designer or QA tester, we want to make sure the app or website that we are working on, looks and behaves flawlessly across all our users' devices and browsers.&lt;/p&gt;

&lt;p&gt;While in the past, it was mostly necessary to do &lt;a href="https://testingbot.com"&gt;cross browser testing&lt;/a&gt; -  nowadays we also have to make sure our website works on all the different mobile devices.&lt;/p&gt;

&lt;p&gt;During development of your website or mobile app, you can easily verify and test your app on a mobile simulator (iOS) or emulator. Overall, these tools do a great job in making sure everything works as it should.&lt;br&gt;
However, simulator or emulator testing alone isn't enough, you need to make sure your app works on devices that your users carry with them in their pocket.&lt;/p&gt;

&lt;p&gt;This article describes how to set up a Mobile Device Lab.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;What is a Mobile Device Lab&lt;/em&gt;&lt;br&gt;
A Mobile Device Lab is usually a closet or table, filled with the mobile devices you want to test on.&lt;br&gt;
In its most basic form, it's a closet where devices are scattered on the shelves, each connected to a power outlet and a wifi station.&lt;/p&gt;

&lt;p&gt;If you intend to only do manual testing, then this kind of setup is usually sufficient.&lt;br&gt;
However, some tweaks, which we'll describe further in this article, might also be helpful.&lt;/p&gt;

&lt;p&gt;If you're looking to do automated testing, for example with Selenium and Appium, then please follow along.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Getting the devices&lt;/em&gt;&lt;br&gt;
We recommend getting mobile devices from a trusted store selling second hand/refurbished devices.&lt;br&gt;
Since these are only test devices, it doesn't really matter if the back of the phone has a scratch. In case of automated testing, we don't even care if the screen has a scratch, since we'll only look at the recorded video of the automated test, and not at the actual device screen.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Power Management&lt;/em&gt;&lt;br&gt;
This is where things get tricky; mobile devices run on batteries. If you intend to store a lot of devices in a rack solution, in some datacenter, then you need to take some things into account:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Batteries tend to overheat&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Batteries degrade&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Make sure you put devices on a metal shelve, since these devices get hot over time because of the battery and charging. The metal shelve will disperse heat better. Leave gaps between the devices, to make sure cool air flows between devices.&lt;/p&gt;

&lt;p&gt;Over time, batteries degrade. A good solution for this is to invest in a good USB Hub. In a Mobile Device Lab we built, we're using a USB Hub from Cambrionix which automatically syncs and charges batteries according to the power profile of the device. This means devices will only charge when necessary, while still being synced to the host computer.&lt;/p&gt;

&lt;p&gt;Monitor the battery levels of your devices. This is possible through ADB for Android or Instruments for iOS. Feed these into a monitoring solution to receive alerts when a battery goes bad.&lt;/p&gt;

&lt;p&gt;Another good tip is to make sure the screen brightness of your devices is turned to the lowest level. This saves power and battery usage. Same goes for locking the screen; after each automated test, make sure to lock the screen so that the display is turned off. Leaving the display on will only draw more power and degrade batteries faster.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Connecting devices to a host computer&lt;/em&gt;&lt;br&gt;
If you want do Automated testing, you'll need a computer that transmits the commands to the device. For iOS devices, this needs to be an Apple computer. We recommend a Mac Mini for this, it is cheap compared to other offerings, and has enough CPU and memory to handle a couple of iPhones or iPads.&lt;/p&gt;

&lt;p&gt;To test apps on your iOS device, you'll need to install a provisioning profile connected with your host computer. This is a certificate from Apple that indicates your computer is allowed to install mobile apps on the device.&lt;/p&gt;

&lt;p&gt;For Android testing, a cheap server can be used running Linux, for example an Intel NUC7i5. Make sure you install the latest Android SDK, authorise USB debugging between the device and the host computer, and you're all set to start automated testing.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Running tests&lt;/em&gt;&lt;br&gt;
This part is pretty easy; there's a very good open-source project available that does most of the heavy lifting, called Appium.&lt;/p&gt;

&lt;p&gt;Simply install Appium on the host computer and after some minimal configuration steps, you will be able to point your tests to this Appium server.&lt;/p&gt;

&lt;p&gt;Once you start a test, you will start seeing activity on the mobile device. This is Appium controlling the device.&lt;br&gt;
After the test is complete, Appium can save a screen recording of the test on your computer.&lt;br&gt;
This way you can see what the test actually did on the device.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Mobile Device Cloud&lt;/em&gt;&lt;br&gt;
If you're not looking to invest time and money in setting up a Mobile Device Lab, there's an online service offering &lt;a href="https://testingbot.com/mobile/realdevicetesting"&gt;mobile device testing&lt;/a&gt;. Simply point the tests you've created to this service and indicate on which physical mobile devices you want to run your tests on.&lt;br&gt;
After a test completes, you'll get access to useful information such as a screen recording, log files and performance metrics.&lt;/p&gt;

</description>
      <category>mobile</category>
      <category>testing</category>
      <category>ios</category>
      <category>android</category>
    </item>
  </channel>
</rss>
