Editions Tagged With 'Java'

120Setting Accelerometer Data for the Android Emulator
Little sensors called accelerometers are a key component of mobile devices today, enabling all sorts of interesting applications. In this edition we take a look at how to use Appium to inject accelerometer values into an Android virtual device, so you can emulate the real-world behavior of users and test apps that depend on changing accelerometer values.
Published Jul 22, 2020
119Using a Tap-By-Location Helper for Working With Unresponsive Elements
Sometimes, finding an element isn't enough to tap on it. You call the element.click() command, but nothing happens! By building a tap-by-location helper, you might be able to get things working agian, especially if the problem is that you need to tap somewhere other than the midpoint of your element.
Published Jul 8, 2020
118Testing Real-Time User Interaction Using Multiple Simultaneous Appium Sessions
Many apps are not 'single-player,' so to speak. They involve the interaction of multiple users, sometimes in real time. Classic examples would be ride hailing, food delivery, or chat apps. While it's possible to mock out all except one of the parties, to get full end-to-end coverage of these scenarios, it can be useful to run multiple simultaneous Appium sessions, on different devices, to act out the various flows for the various participants, all just as it would happen in an actual use case.
Published Jun 4, 2020
116Working with the iOS Home Screen (Springboard)
Appium usually requires an 'app' capability so that it can launch an app that you want to test. But what if you don't want to test any app in particular? In this case, we can decide to start with the 'Springboard' app, which is another name for the iOS home screen or app launcher.
Published May 20, 2020
115Retrieving Clipboard Text from a Real iOS Device
For real iOS devices, the typical commands to get content from the device clipboard don't work. Instead, we have to rely on automating the UI the way a user would. Luckily, that's not too much to ask for Appium!
Published May 6, 2020
114How (And Why) To Create a Custom Expected Condition
When waiting for app state, you're not limited to the built-in expected conditions from the Appium client libraries. You can also create your own expected conditions, which neatly wrap up information about app-specific state, and potentially include helpful side effects as well. As a case study, we examine a particular custom expected condition I created for use with automation of the Zoom app, following an Automation Happy Hour.
Published Apr 29, 2020
113How to Automate the Zoom Video Meetings App
Taking the results of a recent Automation Happy Hour, we explore the Zoom app. How automatable is it? How can we reliably automate the process of joining a meeting? Turns out it's totally doable!
Published Apr 23, 2020
112How to Specify Screenshot Orientation for iOS Devices
Sometimes, for reasons that are currently unfixable, Appium returns screenshots on iOS that don't match the actual orientation of the device screen. This varies based on type of device, iOS version, etc... Luckily, Appium has a special setting you can use to always enforce a certain orientation for the screenshot, if you know what it should be.
Published Apr 15, 2020
109Working with iPadOS Multitasking Split View
One of the greatest features of iPadOS is the ability to run multiple apps at once on the same screen, for a more powerful set of workflows. Using Appium and a bit of thoughtful hackery, we can mimic the user behaviors needed to enter into this Split View Multitasking mode.
Published Mar 19, 2020
108Working with iOS App Home Screen Actions
iOS apps have the ability to give the user access to shortcut actions that can be taken from the home screen. In this article, we take a look at how to automate that user flow using Appium.
Published Mar 12, 2020
107Designing a Cross-Platform Swipe/Scroll Helper
Making sure swiping and scrolling happens equivalently across platforms, and in a way which is super convenient to access from test cases, can be a challenge. In this article I walk through the process of building such a helper in Java.
Published Mar 5, 2020
106Retrieving Status Bar Notifications for Android Devices
Getting the notifications that various apps can leave on your system is a challenging task. Thankfully, Appium has found a way to communicate with its helper app to retrieve these notifications for you and return them to your test script along with a ton of potentially quite-useful metadata.
Published Feb 19, 2020
101AI for Appium--and Selenium!
Appium and Test.ai have been partnering on bringing AI to open source testing for some time. In this article we take a look at how the technology which powers the Appium element classification plugin can also be applied to Selenium, with reference to special new client libraries created for Java and other languages that can help bring a little bit of AI to your Selenium tests.
Published Jan 8, 2020
100Visual Testing With Appium, Part 3
In Part 3 of this visual testing series, we tackle the remaining problems that can plague a mobile visual testsuite, including the challenge of full-scroll screenshots and what to do about screen regions that host changing content and can lead to false positive results.
Published Dec 18, 2019
99Visual Testing With Appium, Part 2
In this second part of the series on visual testing, we think about some of the problems that exist with our home-grown visual testing solution, and explore how the Applitools Eyes SDK is well-suited to making our visual testing more robust and maintainable.
Published Dec 11, 2019
98Visual Testing With Appium, Part 1
You can use Appium for more than functional testing. Another very important category of testing is visual testing, wherein visual elements of the app are compared across runs to ensure that there are no visual discrepancies, which could be a sign of visual or even functional bugs. This is the first in a 3-part series showing how to use open source as well as industry tools to be successful in visual testing.
Published Dec 4, 2019
97Capturing App Launch Metrics On Android
App launch time is a significant performance metric, since it defines a user's first experience of your app. Luckily, with a bit of hackery, this is easy to determine using Appium. Combined with the use of a device cloud service (in this article we explore AWS Device Farm), it's within the reach of most test teams to track app launch performance over time.
Published Nov 27, 2019
96Working With Cookies
When running tests of mobile websites with Appium, it can sometimes be advantageous to work with cookies that have been set in the browser by the application server, using the built-in cookie management commands.
Published Nov 20, 2019
95The 'Android Data Matcher' Locator Strategy
Sometimes, it is impossible or inconvenient to find elements that have not yet been rendered by the Android UI subsystems. Using the Espresso driver, we have access to a special locator strategy that enables us to access elements which have data bound to them, even if the elements themselves are not yet visible.
Published Nov 13, 2019
94Using the Appium Events API
The Appium Events API can be useful for getting a clear look at what's happening underneath the hood of your test, along the dimension of time. Using the Appium Event Parser, you can also generate a timeline to visualize events within Appium itself and within your own test script.
Published Nov 6, 2019
92Using AI-based Object Detection For Finding Elements
The AI-based element finding plugin for Appium now supports another strategy, namely finding all potentially matching icons on a screen, regardless of whether they map directly to elements.
Published Oct 23, 2019
90Optimizing Image Element Thresholds
Finding elements via a template image is a powerful technique for automating apps with non-standard UI elements, as well as games. It can be tricky, though, to know how to appropriately use the threshold setting for finding image elements. In this edition we take a look at a technique for setting this threshold experimentally.
Published Oct 9, 2019
88Saving Test Data To Make Debugging Easier
It's all too common to end up in a position where you're trying to debug a test that was run remotely, without access to any of the data that would make debugging possible. Learn how not to end up in this position by setting your test cases to automatically retrieve and save useful debugging information on test failure.
Published Sep 25, 2019
85Batching Appium Commands Using Execute Driver Script to Speed Up Tests
Appium's client/server model has some disadvantages when it comes to encountering network legacy for each command. Appium has a way around this challenge, by allowing you to batch up commands into a group to be executed server-side.
Published Sep 4, 2019
83Speeding Up Android Screenshots With MJPEG Servers
The best way to speed up Android screenshot retrieval is to read screenshots from what is essentially a special type of video stream known as an MJPEG stream. In this article we show how to set up such a stream and tell Appium how to read from it.
Published Aug 21, 2019
82Streaming Video from iOS Devices
Learn how to record video and view a live stream in a web browser. Also we introduce the `mjpegScreenshotUrl` desired capability.
Published Aug 14, 2019
81Testing Windows Desktop Apps With Appium
Appium is for more than automating mobile apps: it can also automate desktop apps! In collaboration with Microsoft, the Appium team developed a driver suitable for automation of Windows desktop apps, enabling test automation of such apps via the standard Appium API
Published Aug 7, 2019
80Testing iOS Face ID with Appium
Appium has built-in commands for using the iOS simulator's ability to simulate successful and unsuccessful Face ID authentication.
Published Jul 31, 2019
79Converting Java Tests to Kotlin
Kotlin is a growing language which is very compatible with Java. See how simply a Java Appium test can be converted to Kotlin
Published Jul 24, 2019
78Attaching Appium Clients to Existing Sessions
Attaching an Appium client to an existing session can come in handy, and now it's even easier with a new constructor for the Java client.
Published Jul 17, 2019
77Optimizing WebDriverAgent Startup Performance
Our basic demo test suite can be optimized by 67%, reducing the length of every test from 12.8 seconds to 4.2 seconds.
Published Jul 10, 2019
73Working with Multile Webviews in Android Hybrid Apps
Some Android apps are built with multiple webviews, and they're a bit tricky to work with because they don't show up in the context list as you'd expect. Thankfully there's an easy workaround which enables automation of any number of webviews.
Published Jun 12, 2019
72Simulating Slow Internet Connections on Android Emulators with Appium
Learn how to control the network connection quality of Android emulators from an Appium test script.
Published Jun 5, 2019
71Starting an Appium Server Programmatically Using AppiumServiceBuilder
Learn how to use the AppiumServiceBuilder class, which is built into the Appium java client to provide an easy way of starting and stopping an Appium server from within test code.
Published May 29, 2019
70Capturing Audio Output During Testing: Part 2
In the second part of this audio testing series, we look at the all-important step of audio verification, which boils down to determining how similar two different audio files are. This is no easy task, but thanks to the existence of audio fingerprinting libraries, it's one we can handle.
Published May 22, 2019
69Capturing Audio Output During Testing: Part 1
It's not particularly easy, but it is certainly possible to capture and verify audio output for your apps. In the first of this two-part series, we explore the techniques available for capturing audio playback and making it available for later verification.
Published May 15, 2019
68Automating Physical Buttons on iOS Devices
Mobile devices are not always pure screen--they have physical buttons as well. Using Appium's mobile executeScript methods, it's possible to automate several of the physical hardware buttons on an iOS device.
Published May 8, 2019
67Generating Touch Gestures to Zoom In and Out on Google Maps
Google Maps requires some creative touch gestures to zoom in and out, providing a good demonstration of Appium's versatile gesture API
Published May 1, 2019
66Automating System Apps with Appium
Built-in apps which come preinstalled on devices can be automated by Appium on both iOS and Android. This is especially useful when it comes to automating the settings apps for special test requirements.
Published Apr 24, 2019
65Capturing Network Traffic in Java with Appium
Previous articles went over how to capture network traffic on iOS Simulators and Android Emulators during Appium tests, but all the sample code was in Javascript. This edition introduces `mitmproxy-java`, a library based off of `mitmproxy-node`, which allows one to easily run a proxy and capture network requests in a background process in Java.
Published Apr 17, 2019
64Validating Android Toast Messages
A common app notification method on the Android platform utilizes 'toast' messages, which are displayed for a brief period of time and then disappear. Using methods available in Appium's Espresso driver, in conjunction with Explicit Waits, it's possible to verify the behavior of toast messages within your app.
Published Apr 10, 2019
59How to Automate Picker Wheel Controls
Sometimes working with iOS's pesky picker wheels can be an automation challenge. There are two methods for dealing with picker wheels, including a special method custom-designed to work with picker wheels even when the desired value is not known beforehand.
Published Mar 6, 2019
46Sending Arbitrary Keystrokes With The Actions API
The W3C Actions API is about more than building complex touch gestures. It extends to full control over the keyboard (virtual or real), and allows for fine-grained control of keystrokes. Using this portion of the Actions API, you can trigger key input in your app without having to first find an element and then use `sendKeys` on it specifically.
Published Dec 5, 2018
45Automating Voice Commands With Siri
'Siri, how do I automate you with Appium?' While Siri won't have the answer to that question, this edition of Appium Pro does! You can test your app's SiriKit integrations using Appium's `siriCommand` method.
Published Nov 28, 2018
44Working With Web Components (Shadow DOM)
Web Components are an amazing new web standard that promises to ease the pain of code sharing and UI component reuse across your apps and across the web. They do, however, come with a few headaches for testing, since the very thing that makes Web Components sharable and reusable also makes their inner workings hidden from the outside world. There are several strategies for getting inside the Web Component Shadow DOM, however.
Published Nov 21, 2018
43Setting iOS App Permissions Automatically
Using a special capability, you can automatically set the permissions necessary to test your app, which makes dealing with iOS system alerts authorizing those permissions a thing of the past. Some extra system setup is required to make this new capability work, but it's worth it.
Published Nov 14, 2018
42Simulating Incoming Phone Calls On Android
Just as you can generate artificial text messages to an Android emulator, so you can also convince an emulator to believe it's receiving a phone call! Appium has a simple API for triggering incoming phone calls from arbitrary numbers, which can be useful for a variety of reasons, not least of which is making sure your app stays functional during a call.
Published Nov 7, 2018
41How To Test Real iOS Devices With Appium, Part 2
This is the second part in a full tutorial on getting real iOS devices to work with Appium. Assuming everything is installed and set up correctly, this is what you need to do to make Appium work its magic.
Published Oct 31, 2018
40How To Test On Real iOS Devices With Appium, Part 1
Connecting an iOS device to your computer and setting it up to be automated by Appium for the first time can be challenging; follow along with this post to get all the details you need for a first-time installation
Published Oct 24, 2018
39Early-Stage AI for Appium Test Automation
There's been a lot of discussion around the potential ramifications of AI for automated testing. While the debate will no doubt rage on, Appium and Test.ai have teamed up to release a simple integration which allows you to find elements using a machine learning model, making it possible to find icons in your app without knowing anything about your app or looking up selectors.
Published Oct 18, 2018
38Capturing Browser Errors and Logs in Android Web/Hybrid Apps
When using Chrome on Android, or Chrome-backed webviews, it is possible to retrieve logs written by web applications (or hybrid applications) to the browser console. Retrieving these logs is useful for a number of reasons, from observing app state to saving app-internal logs along with test artifacts.
Published Oct 10, 2018
37Capturing Browser Errors and Logs in iOS Web/Hybrid Apps
A lot of information is transmitted through the browser console, some of which is very useful, especially in cases of app errors. Using the log retrieval capabilities of the Appium client, we can gather browser console messages for storage as a test artifact or even to make assertions on app state.
Published Oct 3, 2018
36Using The 'nativeWebTap' Capability
When automating web applications using Appium, we sometimes run into situations where clicking an element doesn't appear to do anything in our tests, even though clicking the element manually works. The nativeWebTap capability comes to our rescue!
Published Sep 26, 2018
34Simulating Hardware Keys And Key Events On Android
Appium automation doesn't necessarily stop at the edge of the screen. Your Android device has hardware buttons (power, volume control, etc...), and Appium gives you the ability to automate these as well, using a generic KeyEvent interface from Android.
Published Sep 12, 2018
33Finding Elements By Image, Part 2
We've already seen how to find elements by image, but this doesn't always work out of the box. There are a number of knobs, dials, and switches you can play with (in the form of Appium settings) that help modulate the behavior of the image matching procedures. These will help fine-tune and stabilize your find-by-element usage.
Published Sep 5, 2018
32Finding Elements By Image, Part 1
When you just can't find an element, whether because it's built using non-standard APIs or has no uniquely identifying markers, it's possible to fall back to image matching via a template image. This technique, when used appropriately, can help overcome roadblocks to automation.
Published Aug 29, 2018
31Automating Custom Alert Buttons on iOS
Alerts in native mobile apps don't always work exactly the same way that alerts in web browsers do, which means we need a bit more than the WebDriver spec can give us. Appium has a special command to help manage the extra buttons that can be present in mobile alerts. In this edition we take a look at how it works on iOS.
Published Aug 22, 2018
30iOS-Specific Touch Action Methods
Sometimes using the standard Action APIs leads to undesired behavior due to the not-always-perfect mapping between the WebDriver spec and the available mobile automation technologies Appium uses. That's why Appium also makes platform-specific action methods available for 'direct' access to underlying action automation methods.
Published Aug 15, 2018
29Automating Complex Gestures with the W3C Actions API
The ability to automate all the actions a user could take is essential, and that extends to touch gestures like pinch, zoom, and tapping with custom durations. Appium can do all this and more, with its support of the W3C Actions API that allows the encoding of arbitrary touch input behavior.
Published Aug 8, 2018
28Running Multiple Appium Tests in Parallel
The best way to achieve a speedy build when it's full of Appium tests is to run those tests in parallel. In this article, we explore how to set up parallel testing locally, utilizing either multiple Appium servers or just a single server hosting multiple sessions.
Published Aug 1, 2018
26Making Your Appium Tests Fast and Reliable, Part 8: Mocking External Services
One of the most common causes of instability or non-determinacy in tests is due to dependence on external services, like a backend API server. Often, when testing your app it is not really necessary to simultaneously test these backend services, and a 'mock' server can be used instead, which greatly increases both the speed and reliability of your tests.
Published Jul 18, 2018
25Making Your Appium Tests Fast and Reliable, Part 7: Disabling Animations
Animations in mobile apps are part and parcel of the beautiful app experience we've all come to expect. They are, however, completely useless for testing. In this edition of the 'Fast and Reliable' series, we look at how to turn them off completely, or otherwise reduce them to speed up our tests and improve test stability.
Published Jul 11, 2018
24Making Your Appium Tests Fast and Reliable, Part 6: Tuning Your Capabilities
You don't have to settle for 'default Appium'. If you find yourself in a place where you're experiencing issues, or want to try a different operational mode, there are a ton of desired capabilities you can check out that modulate the way Appium works under the hood. You might find that the problem you're experiencing has a well-known workaround in the form of a desired capability you can simply plug into your driver initialization.
Published Jul 4, 2018
23Making Your Appium Tests Fast and Reliable, Part 5: Setting Up App State
Functional tests are kind of slow. It's sad, but it's a fact of life and something we don't need to get too concerned about if we remember that, just as in the Matrix, 'there is no spoon'! We can use a variety of techniques to set up app state directly, without having to automate the UI, so that our UI tests can test only the steps which we actually care about for a particular scenario.
Published Jun 27, 2018
22Making Your Appium Tests Fast and Reliable, Part 4: Dealing With Unfindable Elements
Sometimes, for whatever reason, we need to interact with elements that Appium can't find as elements. What can we do when there's no element to call 'click()' on? Hacky things, that's what we do. But we do the hacky things as reliably as we can.
Published Jun 20, 2018
21Making Your Appium Tests Fast and Reliable, Part 3: Waiting for App States
In this edition of the miniseries on speed and reliability of tests, we examine a very important aspect of writing any functional test: making sure that the app is in the state you expect before you attempt to interact with it. Here we learn how to ensure your assumptions about said state are correct.
Published Jun 13, 2018
20Making Your Appium Tests Fast and Reliable, Part 2: Finding Elements
Continuing a larger Appium Pro series on making tests more robust, in this episode we examine the various locator strategies available within Appium, when to use which, and other approaches and practices to making sure your elements are found and not lost.
Published Jun 6, 2018
19Making Your Appium Tests Fast and Reliable, Part 1: Test Flakiness
In this article we start a series that takes a look at a collection of tips and best practices that all contribute to greater speed and reliability of your Appium tests. First off, we discuss the dreaded concept of test 'flakiness', and how we should approach this concept within the world of Appium.
Published May 30, 2018
18Using Espresso With Appium
Espresso and Appium?! That's right, you can access the power and reliability of Google's flagship Android automation technology from within Appium, retaining the ability to write WebDriver-compatible scripts in any programming language.
Published May 23, 2018
17Automating Cross-Platform Hybrid Apps
Hybrid apps contain both native and web components, melded together in some ratio to provide a single unified app experience for the user. With Appium and the various Context commands, it's possible to successfully automate both halves of hybrid apps across both iOS and Android.
Published May 16, 2018
16Automating the Clipboard on iOS and Android
Both iOS and Android allow copying and pasting of text and other types of content. Apps can hook into this native clipboard and provide custom experiences based on clipboard content. Appium gives you special commands to automate the clipboard across both platforms.
Published May 9, 2018
15Testing iOS Push Notifications
Push notifications are an essential part of many apps. How can you test that the appropriate messages are sent? Apple doesn't make it easy, but with Appium there's a way to solve the challenge by automating the notifications shade.
Published May 2, 2018
13Switching Between iOS Apps During a Test
Sometimes being able to automate your app-under-test (AUT) is not enough. People don't have just one app on their phone, and oftentimes your app depends on actions taken in another app. How do you test multi-app flows like this? With Appium, of course!
Published Apr 18, 2018
12Capturing Performance Data for Native iOS Apps
App usability is about more than functionality: if the user experience isn't snappy enough, it can be a big problem. Performance testing and analysis is an important phase of testing. Thankfully, Appium can gather performance data during the course of your iOS tests.
Published Apr 11, 2018
11Simulating SMS Messages on Android
Mobile apps have the possibility of integrating with the core communications functions of mobile devices. For example, they can send or respond to SMS messages. When testing with Appium it's possible to generate SMS messages that show up on Android Emulators, that can be used as part of an app verification flow.
Published Mar 28, 2018
9Testing Android App Upgrades
It's important to test that user data and user experiences are not broken due to changes between app version upgrades. Appium comes with some built-in app management commands that make it possible to test how your app behaves across versions, all within the context of one Appium session.
Published Mar 14, 2018
8How to Find Elements in iOS (Not) By XPath
If you've used Appium for any length of time, you've probably encountered the sad fact that, sometimes, xpath element queries are slow. In this newsletter, we explore why that is the case for iOS, and explore the various alternatives to XPath available to us, especially the little-known 'class chain' locator strategy.
Published Mar 7, 2018
7Speeding Up Tests With Deep Links
Appium tests are full-UI functional tests. They can take a long time to run. It's a good idea to look for shortcuts so that your tests don't have to spend a ton of time setting up state, and can instead focus on just the bare minimum they need to validate. With a little work, you can accomplish this using deep links in both iOS and Android.
Published Feb 28, 2018
6Testing iOS App Upgrades
It's important to test that user data and user experiences are not broken due to changes between app version upgrades. Appium provides some helpful commands to test iOS app upgrades all within the context of one Appium session.
Published Feb 21, 2018
5Performance Testing of Android Apps
Functional testing is not the only kind of testing that Appium supports. As a pure automation library, Appium can also be used in the service of performance testing. In this edition we take a look at an example of performance testing on Android, namely how to track memory usage over time and make assertions about it.
Published Feb 14, 2018
4Using Appium for Testing Mobile Web Apps
Appium is not just for native apps. One of the great things about Appium is being able to test multiple app modes. You can even use Appium to run tests against regular old web applications on mobile devices.
Published Feb 7, 2018
3Running arbitrary ADB commands via Appium
For a long time, it was not possible to run arbitrary ADB commands with Appium. Now it is! Here's how to remove the bumpers and get dangerous with ADB.
Published Jan 31, 2018
2Seeding an Android device with test photos
In this edition we explore the Android equivalent to our previous tip: how to add your own photos to the device so they can be available to media apps.
Published Jan 24, 2018
1Seeding the iOS simulator with test photos
It's often necessary to automate the photo library of a device as part of testing a mobile app. But how do you ensure that photos you know about get there? In this edition, we walk through the methods required for doing this as part of your iOS app testing.
Published Jan 31, 2018