Showing posts with label Mobile Testing. Show all posts
Showing posts with label Mobile Testing. Show all posts

Saturday, 28 January 2023

Appium Interview Questions and Answers Set-03

 


SDET Interview Question and Answers.  

Jenkins Interview Questions and Answers. 

Appium Interview Questions and Answers

Selenium Interview Questions and answers. 

GIT Interview Questions and Answer


APPIUM

Appium was developed by Dan Cuellar and Jason Huggins and today has about 15.2K stars and 5.7K Forks on GitHub. It has the highest market share compared to all the other mobile automation frameworks. Appium is one of the most popular mobile test automation tools, and mobile automation is becoming increasingly popular.


Appium is an open source automation tool for running scripts and testing native applications, mobile-web applications and hybrid applications on Android or iOS using a webdriver.


If you are new to Appium then check out the Video Tutorial for Appium Installation or refer to
 the post here on Install Appium with npm.


 Appium Interview Q&A SET - 01

How to Create an Android Emulator Device


Refer to this post for Appium interview questions and answers for freshers & Appium interview questions and answers for experienced.


How does a typical mobile testing framework function?


A standard mobile testing framework is divided into three segments, namely:

  • Application Package: This is the target mobile app that requires testing.
  • Test Case Runner: It is an instrumentation test-runner for the target app, containing an SDK tool (for building tests) and an API provider (for writing the program).
  • Test Package: There are two classes, known as Test Cases and Mock Objects. Test Case classes comprise test methods, whereas the Mock Objects include mock data and sample inputs for the test cases

Q - Which languages can Appium support?


Appium supports languages capable of supporting HTTP requests. These include Java, JavaScript, Node.js, Python, PHP, Ruby, Perl, among others.


Q. Explain some of the ADB commands used for Mobile testing with Appium?


Ans: Check this POST_HERE on all ADB commands used in Mobile Testing with Appium


Q - What are some limitations of using Appium?

While Appium has many functionalities and advantages, there are some shortcomings to using this automated testing framework for mobile app testing. Here are some of them:

  • It is not possible to test Android versions lower than 4.2.
  • The switching action of an app from the web to native and vice versa is tricky to navigate with Appium.
  • You cannot run Appium Inspector on Microsoft Windows.

Q - What do you mean by an Appium Inspector?


Appium Inspector is similar to Selenium’s IDE record and Playback tools. While Selenium is an automation framework for web applications run on browsers, Appium is a suitable tool for apps that run on mobile devices.


Q - Differentiate between Simulators and Emulators.

Simulation is concerned with modelling the underlying state of the target. In an ideal case, you can observe all the original features in a simulation. On the other hand, emulation involves imitating the externally observable behaviour of the target. While the external state of the emulation matches the target, the same is not true for internal properties.

Simulators and emulators create room for running quick and easy tests inside flexible, software-defined environments without needing to set up a hardware device.


Q - How to Automate Gestures on Mobile? TouchAction Appium: Swipe using Touch Actions in Appium?

Appium supports many gestures as mentioned below, refer to the post HERE to understand how to use the gestures in your automation script,

  1. Tap on an element.
  2. Tap on x, y coordinates.
  3. Press an element for a particular duration.
  4. Press x, y coordinates for a particular duration.
  5. Drag(Swipe) one element to another element.
  6. Multitouch for an element.


Q - Explain Locators with examples.

One can identify the elements of a mobile application through some properties, some of which are standard in nature. The standard app properties are referred to as Locators, for example, ID, name, accessibilityID, className, XPATH, etc.


Q- What is the use of Appium doctor?

Click here for the steps to install Appium-Doctor and how to use it effectively with Appium.


Q - How does FindElement differ from FindElements?

FindElement checks the availability of a specific element in the application UI screen. FindElements can locate multiple elements.

Another difference between the two is that FindElement throws an exception upon not finding any element, but FindElements returns a 0 size array.


Q - Define implicit and explicit wait in Appium.

On certain occasions when there is a delay in loading elements on the application screen, Appium provides the options of Implicit and Explicit Wait, which add a delay for a specified time and for specific conditions, respectively.


Q- How to take a specific element screenshot with Appium?


Ans: Steps to take a specific element screenshot using Appium?



Q - What are the prerequisites for automation testing?

First and foremost, you have to segregate the test cases that you want to automate. Depending on your needs, you prepare the test data and write reusable functions that would be frequently used in your test cases. Then prepare the test scripts and apply loops and conditions as you go along.


Mobile Automation Testing Appium Interview Q&A Set-02





Some of the alternatives to Appium are :
  1. Espresso  

Espresso is a testing framework for Android apps that was created by Google. It is known for its fast and reliable testing capabilities. Espresso is a popular tool among Android developers and supports automation of native and hybrid apps.

  1. Calabash 

Calabash is an open-source mobile automation testing tool that supports Android and iOS platforms. It allows users to write tests in multiple programming languages, including Ruby and Cucumber. Calabash supports automation of native and hybrid apps.

  1. XCUITest 

XCUITest is a mobile automation testing tool that is part of Apple's Xcode development environment. XCUITest supports automation of iOS apps and allows users to write tests in Swift or Objective-C. It is known for its reliability and performance.

  1. Kobiton 

Kobiton is a cloud-based mobile testing platform that supports both Android and iOS platforms. It allows users to run automated tests on multiple devices simultaneously, making it a popular choice for teams with a large number of devices to test. Kobiton supports automation of native, hybrid, and web apps.

*******************************************************************
For any doubts or career guidance, reach out to me 


********************************************************************

****************************************

TOP 15 BDD - CUCUMBER Interview Q&A


************************************************

✍️AUTHOR: LinkedIn Profile

************************************************

Learn (API-Microservice)Testing+ Selenium UI Automation-SDET with Self Paced Videos prepared by FAANG employees and LIVE Doubt Session 

SDET TRANING VIDEOS AVAILABLE with Live Doubt Session(course-1 below,API TRaining Videos With Class Notes and Coding Set) and (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122. 
This includes classnotes, 300+ interview questions, 3 projects, Java Coding question set for product companies along with career guidance from FAANG employees for Automation and SDET.

For more details whatsapp : https://lnkd.in/dnBWDM33

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

https://automationreinvented.blogspot.com/search/label/SeleniumWebdriver

API Testing Interview Question Set:

https://automationreinvented.blogspot.com/2022/03/top-80-api-testing-interview-questions.html

DevOps Interview Q&A:

https://automationreinvented.blogspot.com/2021/11/top-11-devops-interview-questions-and.html 

Kubernetes Interview Question Set

https://automationreinvented.blogspot.com/search/label/Kubernetes

Docker Interview Question Set

https://automationreinvented.blogspot.com/Docker

Linux Interview question Set

https://automationreinvented.blogspot.com/search/label/Linux

Automation Testing/SDET Framework Design

https://automationreinvented.blogspot.com/search/label/FrameworkDesign

Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java

GIT Interview Question Set:

https://automationreinvented.blogspot.com/2021/09/top-40-git-interview-questions-and.html

Coding Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Coding%20Questions

Mobile Testing Interview Question Set:

https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:

https://automationreinvented.blogspot.com/search/label/Python


Sunday, 3 July 2022

How to Automate Gestures on Mobile? TouchAction Appium, Swipe using touch actions in appium

 


Mobile Automation Testing Appium INterview Q&A SET - 01

How To Create Android Emulator Device

Mobile AUtomation Testing Appium Interview Q&A Set-02

Top API Interview Question 1-10




In mobile automation below listed Appium actions most of the time we use only these actions for complete automation. So these actions are very important. we should be aware of these actions

Appium supports the following gestures:


  1. Tap on an element.
  2. Tap on x, y coordinates.
  3. Press an element for a particular duration.
  4. Press x, y coordinates for a particular duration.
  5. Drag(Swipe) one element to another element.
  6. Multitouch for an element.


Appium Supports these gestures using the TouchAction Class.

TouchAction touch = new TouchAction(driver):

Supported methods for TouchAction are:

Method Name
 Purpose
press(PointOption pressOptions)
Press action on the screen.
longPress(LongPressOptions longPressOptions)
Press and hold the at the center of an element until the context menu event has fired.
tap(PointOption tapOptions)
Tap on a position.
moveTo(PointOption moveToOptions)
Moves current touch to a new position.
cancel()
Cancel this action, if it was partially completed by the performsTouchActions.
perform()
Perform this chain of actions on the performsTouchActions.


Before exploring each mentioned action we need to understand the significance of perform() as it plays a vital role. The Appium client simply records all the instructions and actions on the client side and stores the intermediate values in a local data structure. The perform() method is used to send all actions to the appium server - as soon as perform() is called, the intermediate actions and instructions are converted to JSON and sent to the appium server, and then the actual action is being performed. So for any gesture code the last method called would be perform()

Note: This is a common omission during development, forgetting to call perform() and wondering why your test isn’t working!

******************

What are the Locators used for Mobile Automation Testing?


Ans: Click Here For Mobile Testing Locators


**************************



1) Tap on element in Appium:


Method: tap(TapOptions tapOptions)

Usage: It is the simplest action, as the name suggests it will simply click/tap
on a particular location. It is a combination of press() and release()

Example:
TouchAction touchAction = new TouchAction(driver);
touchAction.tap(tapOptions()
           .withElement(element(androidElement)))
           .perform()

NOTE: Here you can also put the wait along with the tap action, for example:


new TouchAction(driver)
.tap(tapOptions().withElement(element(androidElement)))
.waitAction(waitOptions(Duration.ofMillis(millis)))
.perform();

2) Tap on x, y coordinates in Appium:


if you are not able to get the selector for any element for any reason then only one survival option remains. Which is to get the x, y coordinates for that element.

Now the question is how can you get the x,y coordinate?


  • It depends...
  • Because you can get the Pointer location in Android but you can not get it in iOS devices.



   Getting the pointer location in Android:

  1.  Move to Settings > Developer options
  2.  Enable the Pointer location.
  3. Now move to any application for which you need the coordinates of a particular location. Tap on the location and you will get the coordinates for that spot at the top of the screen.

Getting the pointer location in iOS:

iOS does not support the pointer location and there aren’t even any third party apps or tools which come to the rescue. Therefore you need to calculate it using screen resolution and a little bit of prediction. In case you don’t get success at first, you can use trial and error to get the needed location.
Lets look into click tap by x, y co-ordinate method:

Method: tap(PointOption pointOptions) 

Usage: It is used to tap on a particular x,y coordinate point.

Example:

TouchAction touchAction = new TouchAction(driver);
touchAction.tap(PointOption.point(1280, 1013))
.perform()


NOTE: Similar like Tap on element you can put the wait along with the tap action, for example:


new TouchAction(driver)
.tap(point(x, y))
.waitAction(waitOptions(Duration.ofMillis(millis)))
.perform();


3) Press an element for a particular duration :


Method: press(PointOption pressOptions)

Usage: It is used to apply the press action. After the press action you also need to release so that the state would be in press mode. You do so by calling the release() function after calling press().

Example:
TouchAction touchAction = new TouchAction(driver);
touchAction.press(element(element))
.waitAction(waitOptions(ofSeconds(seconds)))
.release()
.perform();

4) Press x, y coordinates for a particular duration in Appim :


Method: press(PointOption pressOptions)

Usage: Similar to Press(ing) an element for a particular duration, here you just need to pass x, y coordinates instead of an element and don’t forget to call the release() function after calling press().

Example:
TouchAction touchAction = new TouchAction(driver);
touchAction.press(point(x,y))
.waitAction(waitOptions(ofSeconds(seconds)))
.release()
.perform();


5) Drag(swipe) one element to an another element in Appim:


Dragging one element to another element is one kind of swiping action.
But here location in coordinates would not matter as we have both of the elements :

1. Element which needs to be dragged,
2. Element upon which another element will be dragged).

TouchAction swipe = new TouchAction(driver)
.press(ElementOption.element(element1))
.waitAction(waitOptions(ofSeconds(2)))
.moveTo(ElementOption.element(element2))
.release()
.perform();


6) MultiTouch in Appim:


As the name suggests it means multiple touches happening at the same time.
For example on iOS if you want to move to the Main screen, you need to use 5 fingers and do a swipe.
Multi Touch is handled by the MultiTouchAction class. It has a  add((TouchActions touchActions) method so in which we need to pass a TouchActions object

So let say you want to press on 5 different points at a time then first you need to create 5 TouchActions, but here the important thing is we are not having a perform method at the end. We just need to call the release method for the TouchAction object, and then pass those values into the add method of the MultiTouchAction class.



    a. Multiple touches at a time.



TouchAction touchActionOne = new TouchAction();
touchActionOne.press(PointOption.point(100, 100));
touchActionOne.release();
TouchAction touchActionTwo = new TouchAction();
touchActionTwo.press(PointOption.point(200, 200));
touchActionTwo.release();
MultiTouchAction action = new MultiTouchAction();
action.add(touchActionOne);
action.add(touchActionTwo);
action.perform();

OR if you want to perform multi touch on particular elements then use the below code snippet.



TouchAction touchAction1 = new TouchAction(driver)
.tap(ElementOption.element(e1))
.release();
   TouchAction touchAction2 = new TouchAction(driver)
   .tap(ElementOption.element(e2))
   .release();

MultiTouchAction action = new MultiTouchAction();
action.add(touchAction1);
action.add(touchAction2);
action.perform();

b. Swiping using multiple fingers.


TouchAction touchActionOne = new TouchAction();
touchActionOne.press(PointOption.point(100, 100));
touchActionOne.moveTo(PointOption.point(500, 100));
touchActionOne.release();
TouchAction touchActionTwo = new TouchAction();
touchActionTwo.press(PointOption.point(100, 200));
touchActionTwo.moveTo(PointOption.point(500, 100));
touchActionTwo.release();
MultiTouchAction action = new MultiTouchAction();
action.add(touchActionOne);
action.add(touchActionTwo);
action.perform();

NOTE: As mentioned earlier only MultiTouchAction should call the perform() method at the end. For TouchActions, the perform() method should not be called otherwise instructions will be sent to the Appium server and the click will happen before the Multi Touch action.

*******************************************************************
For any doubts or career guidance, arrange a 1:1 call with me 


********************************************************************


Learn (API-Microservice)Testing+(CoreJava+UI)-SDET with Self Paced Videos and one LIVE Doubt Session

TRANING VIDEOS AVAILABLE with Live Doubt Session @4500/-(course-1 below,API TRaining Videos With ClassNotes and Coding Set) and 6500/- (API+UI, both course-1 & 2 below) Check Training Page for Course Content or reach out @whatsapp +91-9619094122
Entire course content can be found below:  COURSE CONTENT


***********************




REVISION:==>

==>. How we can verify the Appium installation, what is Appium doctor?


Ans:   To verify that all of Appium's dependencies are met we can use appium-doctor.
Install it with commandnpm install -g appium-doctor, then run the appium-doctor command, supplying the --ios or --android flags to verify that all of the dependencies are set up correctly.


==>. What is the default port for Appium?

Ans: 4723 

This port information is important since we will have to direct your test client to make sure to connect to Appium on this port. If we want to change, the port, we can do so by using the -p flag when starting Appium.

==> What are the important Appium Desired Capabilities?

Ans: 

{

"platformName": "iOS", "platformVersion": "11.0", "deviceName": "iPhone 11", "automationName": "XCUITest", "app": "/path to app" }

==> Mention the Automation engine for android and IOS?

Ans:
Android: UiAutomator2
IOS : XCUITest

Check below link for question and answers with code:

Top API Interview Question 1-10

*************************************************

SeleniumWebdriver Automation Testing Interview Questions:

API Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Rest-API

 
Kubernetes Interview Question Set
https://automationreinvented.blogspot.com/search/label/Kubernetes

 
Docker Interview Question Set
https://automationreinvented.blogspot.com/2020/02/top-18-docker-commands-for-aytomation.html

 
Linux Interview question Set
https://automationreinvented.blogspot.com/search/label/Linux

 
Automation Testing/SDET Framework Design
https://automationreinvented.blogspot.com/search/label/FrameworkDesign


Java Related Interview Question Set

https://automationreinvented.blogspot.com/search/label/Java


GIT Interview Question Set:
https://automationreinvented.blogspot.com/search/label/GIT


Coding Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Coding%20Questions
Mobile Testing Interview Question Set:
https://automationreinvented.blogspot.com/search/label/Mobile%20Testing

Python Interview Question Set for QAE - SDET - SDE:
https://automationreinvented.blogspot.com/search/label/Python
Special Thanks to m-hadimani.

All Time Popular Posts

Most Featured Post

𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀?

❓ 𝗦𝘁𝗶𝗹𝗹 𝘀𝘁𝗿𝘂𝗴𝗴𝗹𝗶𝗻𝗴 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮 𝗰𝗼𝗱𝗶𝗻𝗴 𝗿𝗼𝘂𝗻𝗱𝘀? The issue isn’t your logic—it’s the lack of pattern recogniti...