One point stop for all Mobile Application Testing and Internet of thing knowledge. The key Idea is to share my core experience, information,skills and technical expertise with reference to Native,Hybrid,Web Apps and IOT along with the latest trends,tips and tricks.
Tuesday 9 August 2022
Appium| Locator strategies | Find elements in Native App Android, iOS
Tuesday 7 June 2022
Appium: Tap gesture using Touch Action Class
Friday 5 November 2021
Appium| Locator strategies -2 | Find elements in iOS using iOSClassChain & iOS Predicate String Strategy
This query type is WebDriverAgent's layer over native XCTest lookup function calls defined in XCUIElementQuery class with some additional features, like intermediate chain items indexing and tail-based indexing. Search by direct children and descendant elements is supported.
iOS Predicate String Strategy
Predicate queries are natively supported by XCTest and enable the quick location of elements based on their attribute values.
Follow the rules described in Predicate Format String Syntax article.
Predicate Format Strings are a typical Apple dev thing, and they also work in iOS. Predicate format strings enable basic comparisons and matching. In our case, they allow the basic matching of elements according to simple criteria. What’s really useful about predicate strings is that you can combine simple criteria to form more complex matches. In the XCUITest driver, predicate strings can be used to match various element attributes, including name, value, label, type, visible, etc…
Wednesday 11 August 2021
Introduction to Appium Desktop Inspector| Get to know about various options like Select elements, swipe by coordinates, record script, find elements etc
Monday 2 August 2021
Introduction to Appium For Mobile Testing |Testing iOS,Windows and Android Apps
In this video we are going to see "Why Appium and Benefits of using Appium"
Introduction to Appium
For specific information about what it means for Appium to "support" its platforms, and automation modalities, please see the platform support doc.
Watch below video for understanding appium architecture:
Thursday 22 July 2021
Appium: Native Context and Web-view context for Hybrid application | Entering the web view context
One of the core principles of Appium is that you shouldn't have to change your app to test it. In line with that methodology, it is possible to test hybrid apps the same way you can with Selenium for web apps. There is a bit of technical complexity required so that Appium knows whether you want to automate the native aspects of the app or the web views. But, thankfully, we can stay within the Selenium WebDriver protocol for everything.
Once the test is in a web view context the command set that is available is the full Selenium WebDriver API.
Entering the web view context
Here are the steps required to talk to a web view in your Appium test:
- Navigate to a portion of your app where a web view is active
- Retrieve the currently available contexts
- This returns a list of contexts we can access, like 'NATIVE_APP' or 'WEBVIEW_1'
- Set the context with the id of the context you want to access
- This puts your Appium session into a mode where all commands are interpreted as being intended for automating the web view, rather than the native portion of the app. For example, if you run getElementByTagName, it will operate on the DOM of the web view, rather than return native elements. Of course, certain WebDriver methods only make sense in one context or another, so in the wrong context you will receive an error message.
- To stop automating in the web view context and go back to automating the native portion of the app, simply set the context again with the native context id (generally 'NATIVE_APP') to leave the web context and once again access the native commands.
Automatically entering the web view context on session start
If your application begins in a web view, and you do not want to automate the native application before entering it, you can have Appium automatically enter the web view context on session initialization by setting the autoWebview desired capability to true.
Tuesday 6 July 2021
Automate Android , iOS, Windows UWP with Appium | Creating Desired Capabilities
Automating mobile apps
If you're interested in automating your web app in Mobile Safari on iOS or Chrome on Android, Appium can help you. Basically, you write a normal WebDriver test and use Appium as the Selenium server with a special set of desired capabilities.
Desired Capabilities are keys and values encoded in a JSON object, sent by Appium clients to the server when a new automation session is requested. They tell the Appium drivers all kinds of important things about how you want your test to work. Each Appium client builds capabilities in a way specific to the client's language, but at the end of the day, they are sent over to Appium as JSON objects.
Desired Capabilities can be scripted in the WebDriver test or set within the Appium Server GUI (via an Inspector Session)
Let’s consider an example of Desired Capabilities in Appium represented as a JSON object.
{ “platformName”: “Android”, “platformVersion”: “11.0”, “deviceName”: “Samsung A50”, “automationName”: “Appium”, “app”: “path for the app under test” }
In this video, we are going to create desired capabilities for Android, iOS, and Windows App. We are also going to see how to find the UDID of the iOS device and simulator. And how to find the bundle ID.
Tuesday 9 March 2021
How to kill Appium server if device is not connected | How to find connected Android device
if (loadPropertyFileAndroid.startsWith("Android_")) {
try {
Process process = Runtime.getRuntime().exec("adb devices");
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = null;
Pattern pattern = Pattern.compile("^([a-zA-Z0-9\\-]+)(\\s+)(device)");
Matcher matcher;
while ((line = in.readLine()) != null) {
if (line.matches(pattern.pattern())) {
matcher = pattern.matcher(line);
if (matcher.find()) {
System.out.println("android device connected");
AppiumServer.start();
CommonUtils.loadAndriodConfProp(loadPropertyFileAndroid);
log.info(loadPropertyFileAndroid + " properties file loaded !!!");
CommonUtils.setAndroidCapabilities();
driver = CommonUtils.getAndroidDriver();
String connectedDeviceName = driver.getSessionDetail("deviceName").toString();
System.out.print("Saif "+connectedDeviceName);
log.info("Appium server started");
}else{
AppiumServer.stop();
log.info("Appium server not started");
}
}
}
} catch (IOException e) {
e.printStackTrace();
}
Read about automation coding standards here: Avoid Mobile Automation Coding Pitfalls : Automation coding standards
Saturday 6 February 2021
Installing Appium with WSL ( Windows Subsystem for Linux )
Make sure WSL ( Windows Subsystem for Linux ) is up and running on your windows.I will be using Debian command line environment.
Refer this post on how to setup WSL : IN PROGRESS
For installing Appium through WSL CLI we need
-nodejs
-NPM
Note: It can also be installed using windows command prompt by running likewise command used in windows.
Check if node.js and npm are installed in your system by going to the WSL command line and typing the command
$ nodejs --version
$ npm --version
If they are not installed follow below steps:
Launch WSL Terminal ( In my case it will be Debian)
Start by updating the packages list by typing :
$ sudo apt update
Install the nodejs using the apt package manager
$ sudo apt install nodejs
To verify the Installation execute the following command :
$ nodejs --version
To be able to download npm package, you need to install the npm, the Node.js pacakge manager .To do so type:
$ sudo apt install npm
To verify the npm Install check using the command :
$ npm --version
To verify the npm Install check using the command :
$ npm --version
Install Appium with node.js by typing the following command,
$ sudo npm install -g appium
If you are getting any error/warning related to npm version error like this,
Type and enter below command to fix it to install to latest node version
$ sudo npm i npm@latest -g
and run Appium command again
We will check if Appium is installed by typing the following command
$ appium -v
Start Appium by typing the following command and hit enter
$ appium
You will get something like this
Congratulations!! You have successfully installed Appium with WSL.
Happy Learning 😁
Thursday 17 September 2020
10 tips to avoid Mobile Automation Coding Pitfalls : Automation coding standards
- Have a good code structure in terms of package/class hierarchy.
- Use proper naming conventions at class and function level.
- Not to use parameterization as all data will get hardcoded
- To format the code, indentations make it beautiful.
- To have abstraction at the test case level so all element calls are not made directly
- To implement asserts wherever possible.
- To avoid the usage of absolute paths to find web elements.
- To make the code executable with no library errors.
- Add Comments wherever possible.
- Avoid redundancy of the code. Try to create a reusable method and functions
Thursday 18 October 2018
How to configure desired capabilities in Appium
Desired capabilities are the set of information send to the Appium server whenever we are starting a new session.
They help us in defining the Version of the device,Version of the OS, the device which we are going to use,Application under test path and not limited too......
Below is the screenshot to create desired capabilities from Appium Desktop Interface
Here is the Sample example of the desired Capability for Appium
Interview Experience with AMAZON for the role of Quality Assurance Tester
This role was for Digital/ IoT/Mobile Application based testing :) Amazon is a dream company and everyone wants to work for that company a...
Popular Posts
-
How to Create New AVD (Virtual Device) In Emulator in Android Studio and Install Apk We start AVD in Emulator to test our Android App. AVD...
-
The @BeforeTest methods run after each Test methods . @BeforeTest can be used for creating an initial data set up and prior to running other...
-
Locator strategies supported by Appium: In the video we will see how to find element in different os Android and iOS when doing mobile autom...
-
TestNg provides an option to include or exclude Groups, Test Methods, Classes and Packages using include and exclude tags by defining in tes...
-
In this video we are going to see what is hard assertion in testng Hard Assertion The Default build mechanism of assert is Hard assertion,...
-
What Is TestNG.Xml? TestNG.xml file is a configuration file that helps in organizing our tests. It allows testers to create and handle multi...
-
We are going to understand some of the important Concepts in rest API for sample example I have added a screenshot from Postman which is a p...
-
@BeforeClass: The annotated method will be run before the first test method in the current class is invoked. @AfterClass: The annotated meth...
-
@BeforeTest: This will be executed before the first @Test annotated method. It can be executed multiple times before the test case. @AfterTe...
-
Commonly asked selenium interview questions I will keep updating the list . I have added the answer along with the questions but feel free ...