linkedin Appium Archives - pCloudy

Flutter App Automation Using Appium Flutter Driver

Suyash Dubey
By Suyash Dubey
November 4, 2019
5 min Read
Share This Article
Flutter App Automation Using Appium Flutter Driver

Flutter has been creating waves in the app development space since its launch. The reason is simple, it solves the problem of creating two different codebases for a single app to run on Android and iOS devices. Some experts say that Flutter which was launched by Google is to counter React Native which is used by Facebook. Nevertheless, this is a much-needed relief for enterprises as Flutter will help them save a lot of their time and resources. So let’s first understand what is Flutter.

What is Flutter

Flutter is an opensource mobile UI framework that can create Android and iOS apps from a single codebase. The Flutter framework includes the Flutter engine, Dart platform, the Foundation library, and design-specific widgets. Flutter apps are written in Dart programming language and runs on dart virtual machine.

How to Create a Flutter App

Before we start the process of app development it is important to know that there are two types of widgets, stateless and stateful. A stateless widget describes part of the UI by building a structure of other widgets that describe the UI more definitive. Stateful widgets are the widgets that can change their state multiple times and can be redrawn on to the screen any number of times while the app is in action.

To create a Flutter app you need to install Flutter SDK and other tools required to support the framework. We will create the app in Intelli J IDE and for that, you need to install two plugins. The first one is Dart and the second plugin is Flutter. You can install the plugins by clicking on File in the menu bar of the IDE and then click on Settings.

1

Then you need to create a new project and you will get a basic code layout to start with your app development. In the first line, we have the main method where we will enable the flutter driver extension and there is a run app method with MyApp class instance, to run the app.

Flutter stateless

In this sample code, we have used the title as the stateless widget and we have set the title as the key and for the home screen, we are using one more instance which is MyStatefulWidget(). So in this class, we have a small piece of code, where we have set values for elements like appBar, background color, and in the body, we have placed a floating action button for a counter.

flutter statefull

After adding the code you can run the program and you will be able to see the changed state of the counter with every click on the action button.

Flutter automation

Appium Flutter Driver

Appium Flutter driver is a test automation tool for flutter apps on multiple platforms. It is a part of the Appium mobile test automation tool. But how does the Appium Flutter driver work? It uses webSocket communication to carry WDIO script to instantiate the flutter driver and the request will be sent to the particular application. Then the AUT will send the response to the script through the Appium Flutter driver.

Appium Flutter driver
Appium Flutter driver

You can also build Appium in your machine through the source code. Once you have cloned the source code, run npm install then npm run built and type a command node to start the Appium server. You can download the package from GitHub. The package contains Appium Flutter Driver and Appium Flutter Finder. You can clone the sample project to get the WDIO code.

Flutter sample

In the terminal, you can see that to automate flutter application we have used Flutter as an automation name for both Android and iOS apps. You can see that port is 4723 and in the capabilities, we have mentioned osSpecificOps, automation name: ‘Flutter’. We have mentioned the app path at the top with the device name and platform name and we created an object.

Flutter Terminal

Appium==OS environment is ‘android’ which will pick all the information and specify in the capabilities and it will pass a post request to the server.

Now here we are trying to find the element using CounterTestFinder and a ButtonFinder to click on the button. In the next line, we have created a driver using a remote method.

Then we have switched the Native App context to Flutter. You can switch this if you are using the Flutter app. Once the app is launched, we are validating that the counter text finder has value as zero by calling Flutter APIs internally. So here we are using two actions, one is clicking and the other is touch.

Flutter code

The button is to be clicked two times and thus we have used strictEqual function. In the last line of code, we are deleting the session.

Now to run the test we need to pass the environment variable to connect the device.

Flutter demo

Then we will check if our Appium server is running.

Flutter Appium

Then once you run the code you will be able to see the actions performed on the device and the counter will change to two.

Flutter Appium automation

This is how you can automate your Android and iOS app testing using Appium Flutter driver. Although there are many benefits of using Flutter, there are some limitations as well. The first thing is that you need to learn Dart language to develop and automate the Flutter app.

Suppose you need to run automated tests on multiple devices, then you will have to fire multiple commands in the terminal. Appium flutter driver depends on Flutter Driver APIs and as it’s still not matured enough, some actions cannot be performed.

Suyash Dubey
Suyash Dubey

Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

Related Articles

February 24, 2020
5 Best Practices To Avoid Test Automation Failure

Automation testing forms the core of any CI/CD pipeline and enterprises are keen to practice test automation to enhance the efficiency of the development process. Test automation saves resources and reduces the cost of any project in the long run.…

Learn More Arrow

October 23, 2019
Run Espresso on pCloudy using pCoudy Utility

Espresso is a testing framework for Android which automatically synchronizes your test actions with the UI of your app. It also lets the test wait until all the background activities have finished.   The pCloudy utility uploads your Application APK,…

Learn More Arrow

October 25, 2018
3 Reasons Why Test Automation Should Be Included at the API Level

Importance of Test Automation QA & testing become indomitable especially in the context of API testing. The development teams benefit from automated integration tests at API levels as it helps them in easy integration of apps and higher product adoption…

Learn More Arrow

How to use Appium Inspector for Test Automation

Suyash Dubey
By Suyash Dubey
October 1, 2019
2 min Read
Share This Article
How to use Appium Inspector for Test Automation

Quick Links:

Suyash Dubey
Suyash Dubey

Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

Related Articles

April 19, 2020
What’s New In pCloudy 5.6?

pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

Learn More Arrow

November 15, 2019
How to Choose The Right Automation Testing Tool

Test automation is gradually taking over manual testing as it saves time and improves the quality of testing. Especially in the case of regression testing, automation can improve efficiency by manifold. It is a waste of time and resources to…

Learn More Arrow

September 12, 2019
How To Install Appium On A Mac Machine

[xyz-ihs snippet="quickLinks-Appium"]   In the last blog in this series we learned how to start the Appium server and launch app from the code. In this blog we will understand how to setup Appium on a Mac machine.   Pre-requisite…

Learn More Arrow

How To Install Appium On A Mac Machine

Mallikharjun
By Mallikharjun
September 12, 2019
4 min Read
Share This Article
How To Install Appium On A Mac Machine

Quick Links:

Mallikharjun
Mallikharjun

Mallikharjun works at pCloudy as a Sr. Executive - Digital Marketing. He has 7+ years of experience in SEO, SEM, Social media and Email Marketing. He likes to read current affairs, technology blogs and enjoys Carnatic music.

Related Articles

October 1, 2019
How to use Appium Inspector for Test Automation

[xyz-ihs snippet="quickLinks-Appium"]   In our previous chapter on Android, we learned about UI Automator Viewer, Which is available on Android SDK, to get the properties of the application object. In the case of iOS, Appium itself provides an Inspector which…

Learn More Arrow

August 21, 2019
Starting Appium Server and launching the app from code

[xyz-ihs snippet="quickLinks-Appium"]   In the previous blog in this series, we learned how to write the first Appium script for Android devices. Now in this blog, we will understand how to start the Appium server.   The code structure is…

Learn More Arrow

August 14, 2019
Writing The First Appium Test Automation Script (Android)

[xyz-ihs snippet="quickLinks-Appium"]   In the last blog in this series, we learned how to set up Appium for test automation on a Windows machine. Now we will handle the application by writing the Java code. We will require the following…

Learn More Arrow

Starting Appium Server and launching the app from code

Suyash Dubey
By Suyash Dubey
August 21, 2019
3 min Read
Share This Article
Starting Appium Server and launching the app from code

Quick Links:

Suyash Dubey
Suyash Dubey

Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

Related Articles

April 28, 2020
Test Local And Internal Servers Before Deployment Using Wildnet

Some testing teams set up their own staging environment to test internal servers but as there is no public access which makes it difficult to perform local testing on remote devices. So how would you test your app which can…

Learn More Arrow

April 19, 2020
What’s New In pCloudy 5.6?

pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

Learn More Arrow

January 31, 2020
5 Best Python Frameworks For Test Automation In 2020

Testing framework plays a crucial role in the success of any automated testing process. Choosing the right test automation framework is important as it will maximize the test coverage and improve test efficiency which means a better return on investment.…

Learn More Arrow

Writing The First Appium Test Automation Script (Android)

Suyash Dubey
By Suyash Dubey
August 14, 2019
4 min Read
Share This Article
Writing The First Appium Test Automation Script (Android)

Quick Links:

Suyash Dubey
Suyash Dubey

Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

Related Articles

April 28, 2020
Test Local And Internal Servers Before Deployment Using Wildnet

Some testing teams set up their own staging environment to test internal servers but as there is no public access which makes it difficult to perform local testing on remote devices. So how would you test your app which can…

Learn More Arrow

April 19, 2020
What’s New In pCloudy 5.6?

pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

Learn More Arrow

January 31, 2020
5 Best Python Frameworks For Test Automation In 2020

Testing framework plays a crucial role in the success of any automated testing process. Choosing the right test automation framework is important as it will maximize the test coverage and improve test efficiency which means a better return on investment.…

Learn More Arrow

Appium Setup for Windows

Suyash Dubey
By Suyash Dubey
July 17, 2019
3 min Read
Share This Article
Appium Setup for Windows

Quick Links:

Suyash Dubey
Suyash Dubey

Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

Related Articles

April 19, 2020
What’s New In pCloudy 5.6?

pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

Learn More Arrow

November 15, 2019
How to Choose The Right Automation Testing Tool

Test automation is gradually taking over manual testing as it saves time and improves the quality of testing. Especially in the case of regression testing, automation can improve efficiency by manifold. It is a waste of time and resources to…

Learn More Arrow

October 1, 2019
How to use Appium Inspector for Test Automation

[xyz-ihs snippet="quickLinks-Appium"]   In our previous chapter on Android, we learned about UI Automator Viewer, Which is available on Android SDK, to get the properties of the application object. In the case of iOS, Appium itself provides an Inspector which…

Learn More Arrow

Basics of Appium Mobile Testing

Suyash Dubey
By Suyash Dubey
July 10, 2019
5 min Read
Share This Article
Basics of Appium Mobile Testing

Quick Links:

Suyash Dubey
Suyash Dubey

Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

Related Articles

April 28, 2020
Test Local And Internal Servers Before Deployment Using Wildnet

Some testing teams set up their own staging environment to test internal servers but as there is no public access which makes it difficult to perform local testing on remote devices. So how would you test your app which can…

Learn More Arrow

April 19, 2020
What’s New In pCloudy 5.6?

pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

Learn More Arrow

March 17, 2020
Ensure Continuous Productivity By Leveraging Remote Devices For Mobile App Testing

Remote working is going to be a new normal and remote access tools and platforms will play a key role in maintaining productivity. Working from home has many advantages both for enterprises and teams. There are many tools that help…

Learn More Arrow

How To Achieve Scalability,Quality And Speed With Appium

Suyash Dubey
By Suyash Dubey
July 1, 2019
5 min Read
Share This Article
How To Achieve Scalability,Quality And Speed With Appium

There are more than 5.5 Million apps available on Google Play and Apple App Store combined and by 2022, the number of app downloads will be around 250 Billion. The number of smartphone users in the world is more than 3 Billion and the users prefer using smartphones instead of desktop. This data shows that the mobile app market is very competitive and growing. In this age of digital transformation, the focus of enterprise mobility is to provide better user experience at great speed. The launch of 5G will further complicate the app development and testing process initially. But apart from this, there are three main challenges to overcome and pCloudy is leading the path to bring positive change. Let’s look at these challenges and their solutions.

Challenges Faced by Enterprise Mobility


There is a growing demand for quality at speed in the mobile app industry. The current market dynamics are such that it is necessary to provide the best quality product in less time to remain in the competition. When we talk about mobile app testing, quality can be maintained only when the enterprise can achieve scale. There is a myriad of devices in the market with different OS versions, browsers, Custom ROM, etc. and the app should be compatible with all the devices. How can ensure this and most importantly, how can we speed up the testing process on multiple devices? pCloudy can help you overcome this challenge with its best in the class features. Let’s have a look at them one by one.

Parallel Testing to Achieve Scalability


If we are talking about scalability then testing your app on 5,10 or even 20 devices are not enough for the enterprises to ensure a bug-free app. pCloudy enables to testers to run your test scripts concurrently on 50, 100 or maybe more devices. Enterprises have the option to perform parallel testing in our public cloud or in our plug & play on-premise infrastructure solution. With more than five thousand device browser combinations, enterprises can ensure that the application is working properly in all the devices.

Parallel Testing

Parallel testing on 50 devices


You can see in the picture above, we have set up a device infrastructure for 50 devices for demonstration. Similar device setup can be provided for our on-premise solution and public cloud users can just log into the pCloudy platform and book the devices to perform testing. These real devices can be accessed remotely on the cloud which makes it more convenient for the users as there are no location constraints.

Progressive Reports to Improve Quality


It won’t be efficient to go through each and every report to analyze the data for every device. Instead of that, you get intelligent results where you can do a quick analysis of the errors and then debug quickly. In the pic below you can see the list of results for different builds with their start time, progress, status, and Action.
In the status, you will be able to see how many tests pass, fail, and errors. This way you can concentrate on the tests which failed and you will save time as you don’t have to manually go through all the cases.

Progressive Reports

You can integrate any reporting framework with your existing Appium setup. The same way you have to configure with pCloudy by adding a one-line code while creating an asset.

Test Case Report

In the pic above you can see the test case result in detail. You can see the tags, test case name, build, Automation, and the live status of errors.

Progressive report

Once you expand the test case you can see the logs, Jason format, screenshots, video for that particular session. This information can be used to expedite the test execution.

Integration with AI to Speed up Mobile App Testing


The next challenge is to speed up and simplify the test script creation process. Usually, the procedure is to connect the device to the system and use an automation framework like Appium to use object repositories. If you are using images then the XPath may change depending on the devices.

AI

This AI based utility will help you to get the object repository for the entire page. So if there is an icon for contacts then this utility will automatically recognize the element.

AI Code

In the code, you just need to declare the driver for Appium and for pCloudy as well. Then you need to initialize the drivers and start using the code generated using the AI utility. This is how the script creation is expedited using AI.

Conclusion


To sum up, pCloudy has come forward with solutions for the enterprise mobility to deliver quality at speed with scale. Whether it’s parallel testing, progressive reports or creating a script using AI-based utility, all these features fix the problems that were mentioned earlier. The proverb “change is the only constant” fits well as pCloudy comes up with updates on a regular basis to resolve the issues and make mobile app testing better.


Related Articles:

  • Basics of Appium Mobile Testing
  • Python + Appium + Robot Framework
  • Inspecting Element on pCloudy Devices Using Appium Desktop
  • 5 Reasons Why Appium is The Best Mobile Automation Testing Tool on Device Cloud
  • Help Guide for pCloudy-java-Connector for Appium
  • Suyash Dubey
    Suyash Dubey

    Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

    Related Articles

    October 1, 2019
    How to use Appium Inspector for Test Automation

    [xyz-ihs snippet="quickLinks-Appium"]   In our previous chapter on Android, we learned about UI Automator Viewer, Which is available on Android SDK, to get the properties of the application object. In the case of iOS, Appium itself provides an Inspector which…

    Learn More Arrow

    Appium vs Espresso: The Most Popular Automation Testing Framework in 2019

    Suyash Dubey
    By Suyash Dubey
    March 27, 2019
    8 min Read
    Share This Article
    Appium vs Espresso: The Most Popular Automation Testing Framework in 2019

    Appium vs Espresso

    Mobile app automation testing has evolved as a crucial aspect of the mobile app development process to help deliver better quality solutions, under controlled time cycles and cost schedules. But for delivering bug-free app, choosing the best suitable automation testing framework for your app is very important. There are many automation testing frameworks available in the market with exceptional capacities. This blog is all about Appium vs Espresso and we will analyze which of these two most widely used Automation testing frameworks is preferable for your app testing.

    Espresso was not preferred because of its flakiness and instability issues. But, from the time Google has brought Android Test Orchestrator, a Gradle test option, instability and unreliability of Android Espresso tests have vanished. This, in turn, is creating a serious problem for the most popular automation framework Appium.

    Let’s find out in this blog if Espresso now comes with a power to kill Appium or Appium can hold its stand in this fiercely competitive market.

    Appium vs espresso1
    Let’s get into the details.

    What is Appium?

    It is an open source, cross-platform mobile app automation testing framework. Appium allows native, hybrid and web app testing and supports automation test on physical devices as well as emulators or simulators. The Appium server uses selenium web driver which permits platform independence and allows the user to use the same code for Android or iOS.


    Advantages of using Appium

    • Facilitates test execution without server machines
    • Appium is developed using cross-platform runtime environment like NodeJs which enables programmers to write server-side code in javascript. It is designed as an HTTP server and you can run the test without requiring a server machine.

    • Does not require app code recompilation
    • Most of the automation testing tools require testers to alter app code. Some of the test automation frameworks require testing professionals to recompile the code according to the targeted mobile platforms. Appium enables testers to evaluate both cross-platform and native apps without recompiling and altering the code that often.

    • Automates various types of mobile apps
    • Testers can avoid using different automation tools for different types of apps as Appium can be used for web apps, hybrid, and native apps too. It facilitates the testing of hybrid and mobile web apps as a cross-platform test automation framework. At the same time, it enables testers to test native apps through web driver protocol.

    • Testers can use real devices, emulators, and simulators
    • Testers use real devices to evaluate mobile app’s usability and user experience more precisely. Although, to speed up the mobile app testing one needs to use emulators or simulators too. Appium helps testers to produce reliable test results and reduce testing time by supporting real devices, emulators and simulators.

    • Provides a record and playback tool
    • In Appium, testers can use the inspector to accelerate testing through record and playback functionality. Appium inspector can record the behavior of native apps by inspecting their document object model (DOM). Record and playback tool can produce test scripts in a number of programming languages.

    • Testers can automate apps without adding extra components
    • Testers can execute the same test across multiple mobile platforms without putting extra time and efforts or adding extra component. Appium simplifies automation by keeping complexities in Appium server.

    • Supports several web driver compatible languages
    • You can integrate Appium with many testing frameworks and WebDriver – compatible languages including PHP, Java, Ruby, Javascript, C# and Objective C. Hence, a tester has the option to write test scripts in his preferred programming language.


    Disadvantages of using Appium

    • Common gestures
    • Appium lacks commonly used gestures like double-clicking in java-client libraries. It also does not support Android alert handling directly and the users cannot evaluate alert handling through native API. Testers have to put extra time and effort to test these gestures.

    • No script execution on multiple iOS simulators
    • Simulators make it easier for testers to mimic internal behavior of the underlying iOS devices. Although Appium does not allow users to run multiple test scripts on multiple simulators simultaneously.

    • Lacks the capability to recognize images
    • Appium cannot locate and recognize images automatically to evaluate games and apps precisely. The testers have to take help of screen coordinates to make Appium locate and recognize images.

    • Does not support older versions of android
    • Appium supports only Android 4.2 and later and does not supports older APIs for Android. There are still many people using devices which run on older versions of Android and developers find it difficult to test mobile apps developed targeting older Android API level.


    What is Espresso?

    Espresso is a tool developed by Google which is used for testing the UI of Android apps. It automatically synchronizes your test actions with the user interface of the mobile app and ensures that the activity is started before the tests run.

    Although when you execute an Espresso test you will have shared state in separate tests and some flakiness. For this Google came up with a solution. Android Test Orchestrator is a Gradle test option that helps in testing and increases the reliability of our automated test suites.

    If you use Gradle build tools in any version of Android Studio below 3.0 then you also have to update the dependency setup. Let’s take a look at the advantages of using Android Espresso.


    Advantages of using Espresso

    • Integration with Gradle
    • The new Android Espresso now has the power of the Android Studio and Gradle that comes along with it. So now invoking your tests, running it or modifying it is just a matter of calling a Gradle command. This gives the full power of command line to the developer and makes testability much easier.

    • Test Orchestrator
    • The new Android Espresso comes with the power of Android Test Orchestrator that allows you to run each of your app’s tests within its own invocation of Instrumentor. It ensures that there is minimum shared state and crashes being isolated. It allows you to filter the tests that you want to run and also distribute tests across devices. This implies that you have finer control over how your tests run.

    • Less flakiness
    • The scalability of the test cycle in Android Espresso is high due to the synchronized method of execution. A built-in mechanism in Espresso that validates that the object is actually displayed on the screen. This saves test execution from breaking when confronted with “Objects not detected” and other errors.

    • It’s easy to develop Espresso test automation
    • Test automation is based on Java and JUnit which Android developers are familiar with. There is no setup or ramping up to implement quality in the in-cycle stage of the app SDLC.

    • Reliable and fast feedback
    • Android Espresso does not need any server to communicate with, instead, it runs side by side with the app and delivers fast results. It gives fast feedback to the code changes so that developers can move to the next bug fix.

    • Simple workflow
    • Espresso allows developers to build a test suite as a stand-alone APK that can be installed on the target mobile alongside the app under test and be executed quickly.


    Disadvantages of using Espresso

    • It requires access to the application source code
    • Without the source code, you won’t be able to do anything. Also, There is a risk to get used to the in-built test synchronization and UI – then it might be hard to work with WebDriver.

    • Narrow focus
    • If UI tests are required for both Android and iOS, it will be necessary to write twice, for two different systems. If tests require to work with Android outside the application (for example, open a received notification with a text message), you’ll have to use additional tools, such as UIAutomator.

    • Knowledge of launching Android app on emulators required
    • It is desirable to have at least minimal experience of building and launching Android applications on emulators.


    Conclusion

    Appium and Espresso both can be used to perform UI testing on Android app but if you have to choose one of them then you need to decide on the bases of your requirements. What kind of app is it and what kind of testing you want to perform. Developers who want to perform UI testing for their native Android app should go for Android Espresso. Although, if the test needs to support iOS and Android both and you want to test at a functional level then you can use Appium.


    Related Articles:

  • Automated Testing Using Espresso
  • How to use Appium Inspector for Test Automation
  • How to Run Espresso Test on Remote Devices
  • Espresso with pCloudy.com
  • Run Espresso in pCloudy Using Gradle
  • Suyash Dubey
    Suyash Dubey

    Suyash is a content strategist at pCloudy. He is a frequent contributor to the world's leading mobile technology blogs and tech forums. In his spare time, you will find him reading detective novels, watching a documentary or exploring a new destination.

    Related Articles

    October 23, 2019
    Run Espresso on pCloudy using pCoudy Utility

    Espresso is a testing framework for Android which automatically synchronizes your test actions with the UI of your app. It also lets the test wait until all the background activities have finished.   The pCloudy utility uploads your Application APK,…

    Learn More Arrow

    September 12, 2019
    How To Install Appium On A Mac Machine

    [xyz-ihs snippet="quickLinks-Appium"]   In the last blog in this series we learned how to start the Appium server and launch app from the code. In this blog we will understand how to setup Appium on a Mac machine.   Pre-requisite…

    Learn More Arrow

    July 17, 2019
    Appium Setup for Windows

    [xyz-ihs snippet="quickLinks-Appium"]   In the previous blog, we informed about the basics of Appium and its architecture. Now let's understand how to setup Appium. There are four steps required to setup Appium, they are enabling the Android device for test,…

    Learn More Arrow

    8 Common Appium Mobile Test Automation Mistakes and How to Avoid Them

    priyanka
    By priyanka
    October 12, 2018
    6 min Read
    Share This Article
    8 Common Appium Mobile Test Automation Mistakes and How to Avoid Them

    Appium Mobile Test Automation

    As we all know that Appium is the most preferred test automation tool for mobile applications. It is the first choice of the testers because of its flexibility i.e. it is open source, it has the best supported and highly active community of experts, Appium works across different platforms and works well with different scripting languages. Even after gaining such a popularity and having a strong community base, surprisingly,the users still make mistakes while running the mobile test automation with Appium.

    Here are a few common mistakes that Appium users encounter while using Appium Mobile Test Automation Tool:

    1.Unrestricted X Path Usage:

    Over usage of X Path could be found in case of Selenium as well but when it comes to Appium world, it has more outrageous effects because X Path is a more dynamic way to unearth the elements. But the biggest stumbling block in this scenario is its huge performance cost due to which it becomes elusive an area. This is because Google and Apple do not provide XML or XPath related queries in a way we would need them to be. All of this hospitalizes an unmanageable cost finding elements using X Path. Undoubtedly, X Path is the most trusted method but there are several other better locator methods like ‘Accessibility IDs’ that can be used in this sitch.

    2. Neglected usage of Accessibility IDs:

    The accessibility ID locator strategy is formulated to read a unique identifier for a UI element. For both iOS and Android, getting an element by their accessibility ID is the best method. Most importantly, it is preferable because it is quicker. It should be noted that semantically accessible IDs are different than the Web IDs. However, the two shouldn’t be combined. In many cases, the accessibility IDs are used only for the purpose of testing even though they have a larger purpose. So, in order not to spoil the accessibility of the applications just for the sake of testing, the bigger purpose of the accessibility IDs should be known. If the accessible IDs are set up on the elements to make the apps testable, the app accessibility also increases, provided that the accessibility labels are sensible to the users using them. But the foremost criteria not to make automation efforts a failure is to make the application testable in the first place.

    3. Not making a testable App:

    Developing an app should be a forecasted move where in the developers, even before writing the first line of code, plan to develop an app keeping the automation in mind. This they can achieve by keeping in mind the hooks and the unique IDs for the elements in order to make the app more testable. This strategic approach would be a reason for a successful mobile app test automation. Apart from this, there should also be a concentration on the different testing scenarios in order to elude the chances of overlapping before even getting into Appium coding. An open discussion forum with the development teams to discuss the plotting of right accessibility IDs, labels or Unique IDs for the application’s elements would reduce many test automation reliability concerns.

    4. Disregarding Application View States:

    One of the challenge faced in Mobile Test Automation is not setting up the application. Most of the developers do not set up the application in order to access specific views and user states rapidly. To quote an example given by Jonathan Lipps,one of the key contributors to the Appium project.

    A shopping cart functionality of the app might have ten different tests, and ninety percent of the tests might go through the same steps of logging in and searching items to be put in the cart which is a huge waste of time.

    So, your team should be able to set up an app’s state and start the test in that apposite state, straightaway. This is highlighted in Appium scenario due to the fact that the mobile simulators and emulators are slow and take longer than usual to reach to the right position on the test.

    5. Query for every element visibility:

    Not querying for the visibility of every element is another way to speed up the run-time of the Appium test scripts. This leads to an additional load of calls and waiting time for Appium while in the every activity of retrieving an element. The lag can be reduced by only requesting the element attributes which are important in perspective of the test code.

    6. Native Testing tools – Always better?

    According to some developers, usage of the native testing tools is the best way to get unfailing mobile tests. For example- Espresso in case of Android and XCUITest in case of iOS. This is not good advice as neither of Google or Apple are going to release and new automation technology. When the question is of stability, the stability of code should be chosen rather than technology and in this scenario, Appium is the best choice!

    As an exception, if the development team writes the tests and it’s most comfortable in mobile SDK language, using Google and Apple providers to build development environments. Also, when the constricted test-app or test code-app code integration is needed, then Appium might not be of much help. The utmost value is that Appium provides the WebDriver layer on top of the technology, which means the code can be written in any language and acts as a stable interface to that specific automation technology. Also, being a cross-platform tool, Appium allows to saves a lot of code and architecture in case of testing both iOS and Android devices.

    7. Appium is slow:

    Appium might be slower in some circumstances and also there are points in Appium codes where it does not seem efficient. Appium backs upon technologies that are slower than Appium and the curators of Appium have strategically chosen to utilize slower strategies for specific instances. For eg: Appium will certainly be slower if you are relying on XPath. The efficiency of the tool depends on how it is being used. Mostly, Appium is favored because of stability than the speed.

    8. Not Using Appium Documentation:

    The earlier Appium docs were not very user friendly. As a result, they weren’t used as much as they needed to be but the new Appium documents have been completely redesigned and reorganized. Information about the API reference to Appium, client libraries, supported drivers and Appium commands, code examples which was not provided before is all documented in the updated version. It deserves a revisit due to its newness and can be accessed at Appium.io.

    priyanka
    priyanka

    Tech Blogger - She writes about Technology, Mobile Application Development, Internet of Things, E-commerce, Computing and Design with the aim to coalesce new media and technology.

    Related Articles

    April 28, 2020
    Test Local And Internal Servers Before Deployment Using Wildnet

    Some testing teams set up their own staging environment to test internal servers but as there is no public access which makes it difficult to perform local testing on remote devices. So how would you test your app which can…

    Learn More Arrow

    April 19, 2020
    What’s New In pCloudy 5.6?

    pCloudy is committed to delivering the best solutions in mobile app testing and therefore we come up with product updates at regular intervals. This time we are thrilled to announce the release of pCloudy 5.6 with exciting new features to…

    Learn More Arrow

    January 31, 2020
    5 Best Python Frameworks For Test Automation In 2020

    Testing framework plays a crucial role in the success of any automated testing process. Choosing the right test automation framework is important as it will maximize the test coverage and improve test efficiency which means a better return on investment.…

    Learn More Arrow

    Experience pCloudy Today

    Tickmark No Credit Card Required
    Tickmark Exceptional Security

    Copyright All Rights Reserved © 2020