BLOG

Appium automation

Appium Automation Top 8 Mistakes

 

What is Appium
Appium is an open-source automation tool accustomed to test mobile, web, and hybrid applications. At its heart, it is an internet server that exposes a rest API, and it uses the JSON wire protocol to speak between your script, the Appium server, and real or virtual devices.
“Appium could be a cross-platform mobile UI automation framework. It permits you to write and run UI tests for your mobile apps, for Android iOS, and a few different OSs, and mobile devices. It helps you to write it victimization the selenium JSON driver you recognize and love from internet automation.”
What’s nice regarding this automated approach is that your check may also be written in many alternative programming language bindings. Here are those presently supported and on the market.
C#
Ruby
Python
Java
JavaScript
PHP
RobotFramework
There is even a windows implementation referred to as WinAppDriver that drives desktop applications.
Now here are the highest mistakes, automation engineers build once making Appium web driver tests.

1. Overusing XPath
Overusing XPath locators could be a shared mistake with selenium internet driver, though it is a bit a lot of flagrant error within the Appium world.
XPath could be a terribly powerful thanks to notice components, however, it comes with a fairly huge performance price.
This is thanks to XML- and XPath-type queries, that aren’t natively provided by Google and Apple–at least within the means that we’d like them to be.
This forces Appium to create plenty of expensive calls underneath the hood to support finding components faithfully once mistreatment XPath.
So you’ll use XPath, however, there are even higher locater ways you’ll use–like accessibility IDs.

2. Not creating Use of Accessibility IDs
Using accessibility ID locators is most popular as a result of it’s faster. detain mind, however, that semantically accessible IDs are totally different than IDs in web content. Accessibility IDs have a purpose with the exception of testing, therefore you ought to take care to not confuse or ruin the accessibility of your application for the sake of testing. But this uncovers a deeper issue that causes several mobile automation efforts to fail, which is groups not creating their application testable within the initial place.

3. Not creating Your App Testable
Jonathan and that I each agree that testability is essential. Before one line of code is written for a brand new feature, the developers should be designing their answer with automation in mind. Developers ought to raise themselves, “How am I able to expose a hook or produce a novel ID for this component so as to create it a lot of testable?”Only when an application is made with automation checking in mind right from the start can a team be actually booming with test automation. Besides designing for testability upfront, development groups ought to additionally set up for various testing situations and rely on the way to avoid overlap before diving into cryptography. The main answer to most automation dependableness problems is to possess a conversation along with your development team. Asking them to place the correct accessibility IDs, labels or distinctive IDs for your mobile app’s components can solve several of your check automation problems.

4. Not thinking about Application view States
Another issue eating apple sees ofttimes once you begin to automatize your mobile code is developers not putting in place their applications in order that they’ll get too specific views and user states quickly. For example, you may have 10 totally different tests of cart practicality for your app, with eight or 9 of all surfing constant steps of work in and finding things to place within the cart. These sorts of check duplications ar an enormous waste of your time. You should have the simplest way to line up an app’s state and directly begin a script in this applicable state.
This is doubly vital with Appium as a result of mobile emulators and simulators–being as slow as they are–can typically take a protracted time to induce to the correct purpose on the check. Another way to hurry up your situation isn’t to question the visibility of each component.

5. Querying for the Visibility of each component
Querying for the visibility of each component that you simply retrieve can have an enormous impact on the runtime of your scripts.
When you do that, you are primarily adding an additional overhead of calls and time awaiting Appium to try to to one thing whenever you retrieve the part. You want to take care to solely use idly request component attributes, that are necessary within the context of your check code.

6. Thinking that mistreatment Native Testing Tools is usually higher
Some testers believe that so as to possess reliable mobile tests, it’s perpetually best to use the native testing tools of their developers: If you’re mistreatment mechanical man use java if you’re mistreatment iOS use XCUITest, etc. However, eating apple doesn’t believe this can be an excellent recommendation. How many times have you ever seen Apple break things on purpose releases for unknowable reasons? Or Google cathartic a brand new automation technology each few days? If you are involved regarding the soundness of your mobile check code quite the soundness of the technology, Appium could be a better option. There are bound mobile testing situations during which you’ll in all probability need to use java or XCUIT check directly. For example, if your engineer development team is additionally writing the scripts and they are most comfortable within the mobile SDK language and them are mistreatment the Google or Apple supplier to make tools and development environments and that they need that tight integration between the checks and also the device and typically between the test code and also the app code itself.
If that is however you roll, then Appium is not attending to offer a great deal of profit to you.
Since it provides a WebDriver interface, it means that you’ll write check code in any language. you’ll leverage your selenium expertise also as leverage a shared codebase along with your chemical element tests.
This is a touch a lot of a naturally suited organization that is structured to possess a lot of check engineers accountable for the automation of the code. Sure–it’s nice for code developers to put in writing each app code and check code. during an excellent world, it might be awful. however, I see it.
In reality, this can be not the case in most groups, therefore Appium could be a very powerful tool for them.
The other profit is its cross-platform nature. therefore you’ll find yourself saving a great deal of code and design by mistreatment Appium if you have got to check each iOS and Android device.

7. Blaming Appium for Being “Slow”
Jonathan admits that there in all probability are in all probability instances during which Appium is slower and fewer economical than it has to be.
There are beyond question places within the code wherever it’s not being as economical as potential. For the sake of check stability, several contributors have chosen to use slower ways inbound instances. basically, however, it’s not slower than the technologies it depends on.
In fact, Appium sneakily depends on XCUIT check and UIAutomator2.
So, if you are mistreatment Appium in an inefficient way–relying on XPath, for instance–then affirmative. It’s are slower.
It’s truly apprehensible as a result of at that time Appium has got to work pretty exhausting to work out the way to do what it meant on the underlying automation engine and typically that may be terribly inefficient. Jonathan has found that in most of the cases during which individuals have the same that Appium is “slow,” there’s one thing that may be mounted in terms of however they are utilizing the tool. There are positive situations during which contributors favor stability over speed as a result of sadly, the underlying frameworks are not perpetually stable. If you were mistreatment the seller frameworks directly, you’d positively notice some flakiness, however, Appium camouflages that flakiness with a touch little bit of a performance hit as a result, therefore the exchange is that you simply get a lot of stable check build.

8. Not mistreatment the Appium Docs
In the past, people have tried mistreatment the Appium documentation solely to go away discomfited and never come back.

error

Enjoy this blog? Please spread the word :)

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

Top Mobile and Web App Development Company in USA & India will use the information you provide on this form to be in touch with you and to provide updates and marketing.