Suyash Dubey | Posted on | 2 min Read

[xyz-ihs snippet=”quickLinks-Appium”]
 
Appium is an open source mobile app UI testing framework. You can test all types of mobile apps and perform automation test on physical devices as well as on emulators and simulators. Appium mobile testing does not have a dependency on mobile device OS and it supports cross-platform app testing as a single API works for both Android and iOS. Appium supports many popular languages like C, PHP, Python, C#, Java, Ruby, JavaScript, etc.
 

What is Appium Mobile Testing?

 
When Appium is installed then a server is set up on your machine that exposes the REST API. It receives a command request from the client and executes that command on Android or iOS mobile devices. Then it responds back with an HTTP response. It uses mobile test automation frameworks like Apple instruments or UIAutomator2 to drive the UI of apps.
 

Approaches to Test Automation

 
There is two approaches for mobile test automation, Image-based and Object-based approach. Let’s understand both in detail.
 

Image-Based Approach for Test Automation

 
This technique of object identification is based on the image processing attributes of the objects in the Application Under Test (AUT). Example: Automate user options like “click, type, drag-drop, mouse actions, etc.”
 

Visual verification of the expected output

 
• Not dependent on the platform underneath
• Can be used to automate emulators as well as a real device.
 
Image based approach

The object-based approach of test automation

 
This technique of test automation is based on recognizing the nativity of the objects in AUT. This nativity reorganization process for each individual object in the application is carried out using different attributes that are assigned to the object.
 
It is used to extract the application object identifier with its properties from the actual native operating system source code, just like the developer used. This is an accurate and fast method to recognize the buttons, lists and other objects used by the application.
 
One drawback of the object-based approach is that the recognition of the individual attributes of the object involved restricts these techniques ability to function in test scenarios that require third-party application access. This reduces the automation coverage of utilizing this technique.
 
Object based approach

Which approach should we choose?

 
As we have seen, both approaches have their pros and cons. To get better results, you can merge both approaches and think about devising a hybrid test automation solution.
 
The combination of OCR (image based) and native (object-based) approach allows users to build a single script that will be portable across different devices. It will make your automation robust and efficient and allows the users to confidently detect the relevant native and GUI defect within the mobile application.
 

Appium Overview and Architecture

 
Appium is an HTTP server that manages WebDriver sessions. On iOS devices, Appium proxies command to a UI automation script running on Mac Instruments environment. Apple provides an application called instruments which are used to do a lot of activities like profiling, controlling and building iOS apps. It also provides an automation component where you can write some commands in JavaScript which uses UIAutomation APIs which interact with the app user interface. Appium mobile automation uses these same libraries to automate iOS apps.

Appium Overview and Architecture

The Webdriver Script sends a command in the form of HTTP (JSWP) to the Appium Server. Then the Appium Server will then decide as per the request which driver should be initiated. So, in this case, the Appium Server will initiate the XCUITest driver and it will pass the request to the WebdriverAgent which is an IPA (WebdriverAgent.xcproj) developed by Facebook. WebdriverAgent is responsible to send the command to the Application Under Test (AUT) to carry out the actions in the app. Then the response will be sent to the Webdriver Script through the Appium server.
 
Only iOS 9.3 and above version are supported by the XCUITest Driver. You can find all the capabilities for XCUITest Driver in the link mentioned below.

https://github.com/appium/appium-xcuitest-driver

UI Automation Server flow diagram

The situation is very similar in the case of Android where Appium proxies command to a UIAutomator2 test case running on the device. UIAutomator2 is Android’s UI automation framework which supports running JUnit test cases directly into the device into the command line. It uses Java as the programing language but Appium will make it run from any of the web drivers supported languages.
 
To answer the question “what is Appium automation?”, let’s have a look at the Appium philosophy.
 
Appium philosophy
Appium mobile testing is required for proper execution of continuous integration as it speeds up the overall testing process. Appium mobile testing helps to run the repetitive test which would take more time to perform manually. This is why appium mobile testing is the preferred choice for the developers when it comes to test automation.
 
In the next blog, we will learn more about Appium mobile testing and how to install/configure the Appium setup on a windows machine.

 
Related Articles:

  • How to use Appium Inspector for Test Automation
  • Appium Setup for Windows
  • Starting Appium Server and launching the app from code
  • How To Install Appium On A Mac Machine
  • Appium vs Espresso: The Most Popular Automation Testing Framework in 2019
  • Local Site Testing on pCloudy

     

    With no access to internal or private servers, complexity in the process of VPN connections, or the problems to test a software, website or service in a production-similar environment, testing your local or a private website or url on a cloud platform has always been a challenge for testing teams.

     

    For all the users who have been asking for a solution to test their private servers on pCloudy devices before deploying them on production, we have a good news for you.

     

    Now, you can access your site behind a firewall, on a staging server, or locally with pCloudy before it hits production.

     

    It’s a path breaking feature for enterprise mobility. You avoid the expense of setting up and maintaining a comprehensive and exhaustive testing setup.

     

    Since private servers are internal to your network, they have no public access which makes it difficult to test on a device on cloud. Local Site emulation Testing provides a platform to test private or internal servers on any Android device present on pCloudy.

     

    Let us see how to set up the connection for Local Site Testing:

    1. Login to your registered account on device.pcloudy.com

    2. Select desired device from the Device page and click on “Local Site Testing” icon present at top on right hand side as shown in below screenshot.

     

    Local Site Testing

     

    3. Download the Local Site Testing jar file as shown in snapshot below.

     

    Local Site Testing
    Note: Ignore if jar is already downloaded.

     

    4. Copy the command by clicking on icon as shown in the snapshot.

     

    Copy Command

     

    5. After the file download is complete, Open your command prompt or terminal

     

    Open command prompt

     

    Let us see how to open Command Prompt in different Operating system.

     

    You can follow any of them among three mentioned ways

     

    For Mac-OS users:

     

    a. Open “Launch pad”: It’s the silver icon in the Dock that looks like a rocket. Type “terminal” in search bar and hit enter.

    b. Hold command button and hit space bar. Pop will appear and type terminal and hit enter.

    c. Open Launch pad and click the “Other” folder: It’s a square icon containing several smaller icons. Then look for terminal.

     

    For Windows users:

     

    a. Open Start and type in command prompt or cmd then hit enter.

    b. Click the Windows logo in the bottom-left corner of the screen, or press the ⊞ Win key. You can search for Command Prompt on all supported versions of Windows.

    c. Open the Run program. Hold the Win key and press the R key to open the Run window. Then enter “cmd” or “Command prompt” and press enter.

     

    For Ubuntu users:

     

    a. Using Keyboard Shortcuts: Press Ctrl+Alt+T This will launch the Terminal.

    b. Press Alt+F2 and type gnome-terminal. This will also launch the Terminal.

    c. Press Win+T (Xubuntu only). This Xubuntu-specific shortcut will also launch Terminal.

     

    6. Execute the command on same location where the local site testing jar file was downloaded.

     

    Command executed successfully

     

    7. After the command is successfully executed you will able to see a success message appearing as “Local Site Testing is enabled in your system”. This confirms that now you are ready to test your private server on the device connected on pCloudy.

     

    Local site testing enabled in your system
    Note: Don’t close the command prompt until session ends.

     

    8. Go to the connected device and using the browser open any private URL to test. That’s all you are all set.

     

    connect to the device for local site testing

     

    You can now find more bugs and defects on your local sites before deploying it to production with this breakthrough feature.

     

    Here’s testimony to it by one of our customers from TagIT mobile.
    pCloudy Testimonials Linkedin

    Why don’t you try it yourself and let us know your feedback in comments about how this feature is useful to you!

    Suyash Dubey | Posted on | 2 min Read

    Online Android Emulator to Test Apps

    Android now occupies the number one place in the world Smartphone arena with a market share of 87% at the end of 2016 that means 9 out of 10 Smartphones in the world run on Android. With such dominance in the space, the creation of mobile apps has reached never before heights. But the constant innovation that fuels this market has major problems in terms of the development and testing timelines. Running an online Android emulator, which used to be a solution once up a time, is not good enough anymore. So what can companies and developers do to stay ahead in the development race? What alternates exist to improve your app’s usability, performance and customer satisfaction? Let us explore.

    With the explosion of Smartphones, customers’ screen size is reducing. People are moving from desktops and laptops to Smartphones for their everyday work and personal needs. This massive shift from big screens to a personal device has created a huge opportunity for developers to create tools that can help people with their work and their personal needs. Users can now view their spreadsheets and book movie tickets from their phones.

    Want to test your Mobile App?

    Join pCloudy Platform!

    Apple’s Appstore and Android Play store has become the ‘go to’ place for people to discover apps that meet their requirements. The ratings left on those apps will decide how many people will install those apps. Customers have once again become the king of the market.

    Days of unique apps are over. For your every need you will find at least two or more apps, giving you a choice. So if you want people to choose your app, install it, use and positively review it, your app needs to user-friendly, work on most handsets and be bug-free.

    In the past, companies and developers determined product lifecycle. They planned the updates, feature upgrades etc based on the resources and other factors. Today the scenario is changed. The Market dictates the timeline. If your app is incompatible with the latest OS, or not render properly, or suck a lot of battery juice, off it goes into oblivion to be replaced by a better app.

    The fight for the screen space is constant.

    You can win the fight only if you develop faster than others, test it better and offer a good user experience. That means developers will need to compress their development cycle and testers should speed up their testing while at the same time, maintain high usability and reliability of the app.

    Android and iPhone both offer an easy to use platform for developers. iPhone has a few products (IP6, IP7, IP8 etc.) and versions (OS 8, OS9, OS10 etc). The permutation of devices and OS makes testing with real devices easier although buying that many Apple devices is quite an expensive investment. You don’t need an online emulator while testing for iPhone.

    In contrast, Android has a highly fragmented market. Apart from different versions (KitKat, Jellybean etc), there are different forks of Android (Stock, Cyanogen, OxygenOS etc) and there are also different skins that manufacturers put on their devices (TouchWiz, Optimus, Sense etc). Real android device testing to cover all the combinations is close to impossible and quite expensive.

    Enter Online Android Emulators

    Online Android Emulator

    When they started, online Android emulators were like a boon to developers. They could cross test their apps across different devices without physically buying the phones. Most of the Android emulators were easy to set up and a fairly inexpensive solution. Most importantly, online Android emulators could mimic hardware and software behaviour making easy for developers to identify unexpected behaviour during the early stage testing.

    But as the market for apps grew, the demands on the app became even higher. Testing all the features of the app on an Online Android Emulators was not providing the full picture of how the app would behave on a customer’s phone.

    For example, a user installs a new app on the phone and the next day he notices the battery is getting low very fast. Looking at the battery usage, he discovers the culprit is the new app and bam! He hits uninstall. He then visits the Playstore and writes a negative review of the app’s battery-sucking problem. The next 20 people who see that review will not install the app.

    These kinds of bugs cannot be easily identified using an online android emulator. Apart from that, online emulators are slow because they have to replicate both software and the hardware components. thus slowing down the whole testing cycle.

    Online android mobile emulator stimulate android devices on a PC to test an app on a variety of devices and API levels without the need for physical devices. Nox is the best online android emulator although BlueStacks is the best android emulator for online games. Online android emulators come with predefined configurations for various Android phone, tablet, Wear OS, and Android TV devices. There are many online android emulators for iOS available in the market.

    Online Android emulators also have other limitations that make them unsuitable for large-scale testing. There are a limited number of OS versions you can run on an Android emulator. Even on a good PC with HAXM acceleration support, you can run approximately 8 emulators at a time. Even if you manage to set up all the online emulators you need, one small problem can send the whole system crashing forcing you to start all over again.

    So what can app developers do to speed up their product lifecycle while releasing a relatively bug-free app? Is there any alternative for Online Android Emulators?

    real mobile android and ios devices

    Testing on real devices has a few important benefits. Your testing can be in real conditions i.e. weather, location network accessibility, interruptions like SMS, calls etc can be tested accurately. You can also validate the screen brightness, visibility in different lighting conditions. Testing on a real device will be a lot faster than on an Android emulator.

    The biggest problem in using actual android phones is the cost of buying all the phones you need to test. There are approximately 11k Android phone models in the market making it financially impossible to test on all available Android devices. This is one reason Online Android Emulators became famous in the initial stages.

    You can run only one test at a time. If you have staff in another city or country, they cannot access the device. If you need to install an app, you have to do it manually on every device. Apart from that, there is also a question of logistics, maintaining the devices, updating them, etc all of which are time-consuming tasks.

    One tactic used earlier involved a combination of using online Android emulators during the early stages and a small selected list of real Android devices during the beta testing. While this would work for a localized team, it still does not optimize device usage and covers a tiny portion of devices while the fragmentation continues. Thus it is not an optimal solution.

    Is there a third alternative that can beat the disadvantages of online android emulator and real devices testing?
    In recent times, a new mode of testing is gaining popularity among both amateurs as well as professional developers. It is called Mobile cloud testing.

    What is Mobile cloud testing?

    mobile cloud testing

    Testing on real devices using the cloud as the Interface is the new way of balancing the real android testing while making it economical and scalable. As a developer, you need not own any phones or buy expensive software. You connect to a lab that has a huge selection of Smartphones, select the ones you want to test on and start, it is that simple. You can run functional tests, automated tests, performance and other forms of tests easily. Since the interface is cloud-based, you can test from anywhere in the world, at any time.

    There will be some changes in the way you set up your test, install an app, etc. All the testing though will happen on actual devices under user-level conditions. You can set the location, observe CPU utilization, battery drainage and pretty much anything else that you can do with a device in your hand. These are the things you can never test with an online Android emulator.

    The best part is that you need not invest in any special infrastructure for such a facility. There are independent services providers who can allow you access to the device on a cost per use basis. You can even reserve devices in advance if you want to plan a battery of test over an extended period.

    Opting for mobile cloud testing service gives you access to real devices at a fraction of a cost of setting up your own lab. There are no recurring charges as most of them use a ‘pay as you go’ model. You can spend all your time in testing rather than worry about the infrastructure, maintenance and other problems that come from the ‘owning’ model.

    While there may not be a cost associated with getting Android emulators, they need a lot of expensive hardware to run a sufficient number of an online android emulator. Mobile cloud testing does not have a problem.

    Using Mobile cloud testing, you can cover more ground over a large number of devices than if you were using either only real android device testing or the online android emulator. For example, if you have 10k scenarios to cover, you can spread it over 1k devices through automation rather than 1k test scenarios over 100 different online android emulator.

    One of the biggest benefits of testing mobiles over the cloud is that you are more likely to discover bugs that affect real-world customers than what an emulator can reveal. From a user satisfaction perspective, this is probably one of the biggest advantages mobile cloud testing has over online android emulator.

    Most of the app development work has moved to the agile methodology which means testing will run almost parallel to development work. You will need a way to speed up the testing process to meet the sprint deadlines.

    Using a mobile cloud, it is easy to streamline the testing process whether you are using a DevOps or an agile approach. Continuous testing is a lot easier to streamline over the cloud setup rather than via online Android emulators or even with real devices.

    Many development teams are spread across the globe. Cloud setup gives them an easy way to test seamlessly from different geographies.

    Security for Mobile apps testing

    mobile app testing

    Different apps have different needs in terms of security. An Astrology app that gives general predictions may have little data security requirements while a banking app might need the testing to be done in a secure environment. Such clients can always go for a private cloud or even opt for on-premises setup. When you use a good solution provider, you can just hook up your existing devices to their setup and give access to your cross-border teams to test on the devices.

    Testing performance issues, be it CPU load, battery discharge or performance over 2G, 3G and other networks work a lot easier when you use the mobile testing via the cloud platform. You can select which network mode you want to be on and apply the test. This kind of flexibility is difficult and sometimes, impossible using an android emulator.

    Mobile Apps Performance Testing

    mobile apps performance testing

    Apart from the need to test for compatibility with existing apps, battery usage, network usage etc, and mobile apps will need to go through a round of performance testing. Due to the ever-increasing storage space in a Smartphone, users tend to store a lot of content on their phones. So it is necessary to find how the increase in storage affects the application performance.

    For example, if you are developing a photo gallery, how does your app perform when accessing 5 GBs worth of pictures and videos, v/s accessing 50 GBs worth of pictures and videos? Does it slow the pre-fetch? Customers are very unforgiving of apps that slow down their phones.

    In case your app has a server-side component, it is important you run a performance test to verify how many concurrent users the server can handle. There have been many instances where e-commerce sites crashed being unable to keep up with increased demands during holiday sales.

    These are a few areas that we cannot test on an online android emulator.

    A customer kept waiting is a customer lost

    A couple of years ago, it was acceptable to wait for two-three minutes to download an image on a phone. But today if your app takes longer than few seconds to start up, it is killed and replaced. The tide has shifted to the customer’s side in the Appstore and Playstore. The only way to win this game is to be Nimble, easy to use and not crash the phone.

    Thanks to Mobile cloud testing, you don’t have to wait for the slow, unreliable online Android Emulators anymore. Testing on Mobile cloud gives you the opportunity to cut your infrastructure cost, speed up your testing cycle, spread your testing over a larger set of devices and gives you close to real-world results. As the completion heats up for the screen space, you have one tool in your kit that can help your app survive the tough jungle of user reviews.

    Want to test your Mobile App?

    Join pCloudy Platform!

    Anshuman Chatterjee | Posted on | 2 min Read

    Uncover Memory Leaks by Mobile Apps

     

    Mobile apps can often crash for many reasons. Nothing is as excruciating as memory leaks. It starts with your app crashing often, or becoming slow or maybe making your entire phone slow down, taking longer time to load activities. Memory leaks are notoriously hard to detect, and thus can easily surprise you. Have we ever thought why most of the users uninstall the application after some use?

    Which is why it is critical for Developers to understand the memory consumption by any mobile application. How do you detect memory leaks during Mobile Application Testing? And if so, how can you prevent them from hogging mobile resource consumption?

    A little knack for Mobile Application Testing always comes handy.

     

    mobile application testing
    Figure 1: Image Credit- GadgetHacks

     

    Want to test your Mobile App?

    Join pCloudy Platform!

    Memory is critical to device

     

    Memory is one of the key resources of the mobile device.And memory leaks in Android is an important thing to be kept in mind. Java is a garbage collecting language, which removes the need for developers to dig deep to manage allocated memory. This reduces the chances of any segmentation fault crashing an app or any unfreed memory allocation from eating up space of the heap area, thus creating a safer code.

     

    However, a garbage collector is never an insurance against memory leaks. There are other ways by which memory can be leaked within Java. This means that your android mobile application is still pretty prone to wasting unnecessary memory allocation and crashing with out-of-memory (OOM) errors.

     

    Toptal
    Figure 1: Image Credit- Toptal

     

    Why are Memory Leaks Bad?

     

    Cause: Memory leaks occur when some variable of the application still has references to some objects that are unnecessary, no longer in use or used to be with the app anymore, is bloating the allocated memory heap and the Garbage Collector is not being able to release that memory.

    Effect: Android devices mostly run on phones with limited memory, so as a result of too many leaks, the app runs out of available memory. This triggers more frequent Garbage Collector events which paralyze the device (Stop-the-world GC events) by almost stopping the rendering of UI and processing of events. This leads to an Out of Memory Exception and translates to the user as the app being unresponsive.

     

    Android App Testing

     

    Testing for Memory Leaks

     

    Memory Leaks are caused by the failure to not be able to de-allocate memory that is no longer in use, which is why they cannot be identified during black box testing. The best phase to find the memory leaks is when developers are developing the application, at a code level.

    It’s best to check for memory leaks during unit testing. However, testers can follow these tips:

     

    Release Unused Memory: Memory leaks can be present because of the bad design of the application and thus might consume lot of memory when the application is in use

     

    Test on Multiple devices:The memory consumption by the application should be monitored while doing the system & functional testing. One shouldn’t rely on a single device testing as there are plethora of devices in the market.

     

    Detecting Memory Leaks

    There are quite a few techniques and tools devised by developers to pin point memory leaks. Android’s very own Android Studio has a powerful tool to monitor not only memory usage but also for network, GPU and CPU usage as well, called the Android Monitor.

    Memory Monitor in this helps track memory usage, find de-allocated objects, identify memory leaks and helps get an overall sense of how your app allocates and frees memory. It’s done in three steps:

    1. During and use and debugging of app, track the memory monitor. If the memory usage graph rises for your app and doesn’t fall even if put in background, it’s a memory leak.

    2. Using the Allocation tracker, you can check the percentage of memory allocated to different types of variables in your app. This gives you a sense of how much memory is consumed by which object.

    3. Create a Java Heap Option to create a heap dump that keeps a snapshot of the memory at any given point of time, thus providing the data consumption data.

    Despite Android’s monitor to detect memory leaks, there are a few platforms from developers that help extract memory consumption data without so many steps for faster testing cycles.

    pCloudy’s very own platform for example, generates the statistics for Memory consumption while doing the normal functional Mobile Application Testing on real mobile devices.It also generates other vital data such as CPU consumption, battery consumption & data consumption for testers and developers who reiterate several test cycles across multiple physical devices.

     

    mobile application testing
    Figure 1: Image Credit- Android Developers Studio

    Want to test your Mobile App?

    Join pCloudy Platform!

    Jenkins World 2016

    (Femont, CA) – Smart Software Testing Solutions (SSTS Inc.) is proud to announce that pCloudy, a cloud-based mobile and IoT application testing platform, will be sponsoring CloudBee’s upcoming Jenkins World 2016 Conference at the Santa Clara Convention Center in Santa Clara, California, on September 13-15, 2016.

    The key features and capabilities using pCloudy has quickly developed the reputation as the leading mobile and IoT application testing platform. pCloudy provides application developers robust solutions including three testing options: public, hosted, and on-premise. All three solutions allow users to perform functional and performance based testing on real Google Android and Apple iOS mobile devices. With full debugging features, analytical and performance tools, and recording session videos among other critical features, pCloudy continues to push the boundaries of mobility testing.

    “pCloudy continues to innovate and push the envelope in the world of mobile testing. This sponsorship allows us to reach some of the world’s leading Jenkins focused application developers and testers to introduce the Jenkins integration within pCloudy. The opportunity to discuss pCloudy with everyone in attendance will be a great opportunity for us.” a spokesman said.

    Jenkins World 2016 Conference is the flagship event for Jenkins users and professionals hosted by CloudBees. As one of the longest-running events, it brings together some of the industry’s leading thought leaders, practitioners, and solution providers. This year’s event is headlined by Kohsuke Kawaguchi of the Jenkins Project, Sacha Labourey, CEO of CloudBees, and author Gary Gruver. In addition to the headlining presenters, attendees and solution providers come from all wings of the industry.

    pCloudy will be available for scheduled meetings and walk-ins within the exhibition hall. Please feel free to stop by booth K19 to learn more.

    To learn more about pCloudy please reach out directly to schedule a meeting or to learn more information:

    Samir Sampat
    pCloudy
    P: 510-460-1868
    E: samir.sampat@pCloudy.com

    About pCloudy:
    pCloudy is the simplest online device cloud, that provides customers with the necessary tools for convenient, effective, and immediate testing for their mobile strategy. It enables continuous development and testing on real mobile devices. Our unique debugging feature for app developers pinpoints potential errors that will significantly reduce costs and time. With pCloudy testing, the reduction in release time allows developers to focus on improved features instead of corrections.

    About Jenkins World 2016:
    Jenkins World will bring together the largest gathering of Jenkins users in the world, including Jenkins experts, continuous delivery thought leaders and companies offering complementary technologies for Jenkins. Jenkins World will provide opportunities for attendees to learn, explore and network face-to-face, as well as to help shape the future of Jenkins.

    About CloudBees:
    CloudBees, the Jenkins Enterprise company, is the continuous delivery (CD) leader. CloudBees provides solutions that enable IT organizations to respond rapidly to the software delivery needs of the business. Our offerings are powered by Jenkins CI, the world’s most popular open source continuous integration (CI) server. The CloudBees Continuous Delivery Platform provides a wide range of CD solutions for use on-premise and in the cloud that meet the unique security, scalability and manageability needs of enterprises. Our solutions support many of the world’s largest and most business-critical deployments.