Mobile Testing
14 Best Mobile Testing Tools for Android & iOS App [Free/Paid]
Mobile Testing Tools help you automate testing of your Android and iOS Apps. These Mobile...
This tutorial will help you to understand APPIUM automation tool. It will cover desired capabilities and APPIUM with Maven uses.
In this tutorial, you will learn-
'Desired Capabilities' help us to modify the behavior of server while Automation. In Appium, it is a type of hashmap or key-value pair, used to send a command to APPIUM server. In APPIUM, all the client commands are running in the context of a session.
For example, a client sent POST/session request containing JSON object to APPIUM server.
Hence, to send any desired request or to maintain any desired session with the server, a set of Key and value pair is used. This is known as 'Desired Capabilities.'
import io.appium.java_client.AppiumDriver; import org.openqa.selenium.remote.DesiredCapabilities; { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName","Android Emulator"); capabilities.setCapability("platformVersion", "4.4"); }
Important Role of Desired Capability-
DesiredCapabilities obj = new DesiredCapabilities(); obj.setBrowserName("firefox"); obj.setVersion("18.0.1"); obj.setPlatform(org.openqa.selenium.Platform.WINDOWS);
Org.openqa.selenium.remote.DesiredCapabilities
APPIUM supports both Android and iOS. Therefore there are a separate set of Appium server capabilities.
Below table depicts some commonly used Android capabilities and its value to use-
Capabilities | Description | Values/Uses |
---|---|---|
appPackage | Call desired Java package in android that user want to run | Value= com.example.myapp/ Obj.setCapability("appPackage", "com.whatsapp"); |
appActivity | Application Activity that user wants to launch from the package. | Value= MainActivity, .Settings Obj.setCapability("appActivity", "com.whatsapp.Main"); |
appWaitPackage | Package from which application needs to wait for | Value=com.example.android.myapp |
appWaitActivity | Any Android activity that user need wait time | Value= SplashActivity capabilities.setCapability("appWaitActivity", "com.example.game.SplashActivity") |
NOTE- Refer this link 'https://appium.io/docs/en/writing-running-appium/caps/#android-only' to view more Android Capabilities
Below table depicts some commonly used iOS capabilities and its value to use-
Capabilities | Description | Values |
---|---|---|
LaunchTimeout | Total time (in ms) to wait for instrumentation. | 2000 |
UDID | To identify unique device number for connected physical device | 166aestu4 |
NOTE- Refer this link 'http://appium.io/slate/en/master/?java#ios-only ' to view more iOS Capabilities
Packages are related to bundled files or classes. It gives an organized structure to modular programming. In Java, different packages are stored in a single Jar file. The user can easily call the jar file for full execution. Similar concepts followed in Mobile application development world.
In Android operating system, all applications are installed in the form of JAVA packages. Hence, to extract packages path information, Android PackageManager class is used.
It retrieves package and activity information of pre and post installed application. It is installed in Android devices.
You can get an instance of PackageManager class By calling getPackageManager().
This method can access and manipulate the packages and related permission of the installed applications.
For example -
PackageManager pManager = getPackageManager(); List<ApplicationInfo> list = pManager.getInstalledApplications(PackageManager.GET_META_DATA)
Summary:
Mobile Testing Tools help you automate testing of your Android and iOS Apps. These Mobile...
A frequent question from our learner's is How to test Mobile Apps? In this tutorial, we provide...
For any mobile app, performance is very critical. If your Mobile App does not perform well, the...
What is UiAutomatorViewer? "UIautomatorviewer" is a GUI tool to scan and analyze the UI components of an...
What is Calabash? Calabash is an open source Acceptance Testing framework that allows you to write...
Download PDF 1) Explain what is Appium? Appium is a freely distributed open source mobile...