Sunday 28 November 2021

Top Mobile Automation Testing Interview questions for QA-SDET-QAE? Basic concepts and setup for Appium? Appium Interview Q&A


How to send email notification with groovy script in Jenkins pipeline?

Pipeline Script Fundamentals

Click Here:   DevOps Related Posts


Training Session for API-Microservice-SDET will start soon, for demo session on 18th DEC please reach out on whatsapp @ 91-9619094122

1. How to install Appium?

Appium can be installed in one of two ways: via NPM or by downloading Appium Desktop.

a. Installation via NPM

If you want to run Appium via an npm install, hack with Appium, or contribute to Appium, you will need Node.js and NPM (use nvmn, or brew install node to install Node.js. Make sure you have not installed Node or Appium with sudo, otherwise you'll run into problems).

npm install -g appium


b. Installation via Desktop App Download

Simply download the latest version of Appium Desktop from the releases page.

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

To check API related topics and interview tips, check below and keep reading:

Most Asked API Question For SDET
*************************************************

2. 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.


3. 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.


4. What are the important Appium Desired Capabilities?

Ans

{

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

5. Mention the Automation engine for android and IOS?

Ans:
Android: UiAutomator2
IOS : XCUITest


6. What are the locators for Appium which supports the Mobile JSON Wire Protocol locator strategies?

Ans
  • -ios predicate string : a string corresponding to a recursive element search using the iOS Predicate (iOS 10.0 and above)
    • -ios uiautomation for iOS 9.3 and below
  • -android uiautomator: a string corresponding to a recursive element search using the UiAutomator Api (Android-only)
  • -android datamatcher: a string corresponding to an Espresso DataMatcher json (Android-only)
  • accessibility id: a string corresponding to a recursive element search using the Id/Name that the native Accessibility options utilize.

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

Check Selenium-SDET-UIAutomation Questions set 11 to 20:
Qus Set - 11 to 20

Check Selenium-SDET-UIAutomation Questions set 21 to 30:
 
*************************************************

7. What is the use of Touch Action?

AnsTouchAction objects contain a chain of events.

In all the appium client libraries, touch objects are created and are given a chain of events.


8. What are the available events from the Touch Action spec?

Ans:
* press 

* release

 * moveTo 

* tap 

* wait 

* longPress 

* cancel 

* perform

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

Check Selenium-SDET-UIAutomation Questions set 31 to 40:

 Question Set 31-40  

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

9.  What are the Locators used for Mobile Automation?

Ans: Click Here For The List Of Locators

10. How to use Find Element to identify Mobile elements?

Ans: 
MobileElement elementOne = (MobileElement) driver.findElementByAccessibilityId("SomeAccessibilityID");

MobileElement elementTwo = (MobileElement) driver.findElementByClassName("SomeClassName");

If you like my work and want to say thank you then spread the word or buy me a coffee :)

🍵🍵🍵🍵 Buy Me A Coffee  🍵🍵🍵🍵


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

SeleniumWebdriver Automation Testing Interview Questions:

 
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

Mention the locators used for Mobile Automation?

 

Check Selenium Interviewquestions from 1 to 10 below:


Check Selenium-SDET-UIAutomation Questions set 11 to 20:
Qus Set - 11 to 20

Check Selenium-SDET-UIAutomation Questions set 21 to 30:
 
Check Selenium-SDET-UIAutomation Questions set 31 to 40:

 Question Set 31-40  

Check Selenium-SDET-UIAutomation Questions set 41-50:

Q&A Set 41-50

Check Selenium-SDET-UIAutomation Questions set 51-70:

Q&A Set 51-70


Mention the Locator strategies for Mobile Automation?
Mention the locators used for Mobile Automation?


StrategyDescription
Accessibility IDRead a unique identifier for a UI element. For XCUITest it is the element's accessibility-id attribute. For Android it is the element's content-desc attribute.
Class nameFor IOS it is the full name of the XCUI element and begins with XCUIElementType. For Android it is the full name of the UIAutomator2 class (e.g.: android.widget.TextView)
IDNative element identifier. resource-id for android; name for iOS.
NameName of element
XPathSearch the app XML source using xpath (not recommended, has performance issues)
ImageLocate an element by matching it with a base 64 encoded image file
Android UiAutomator (UiAutomator2 only)Use the UI Automator API, in particular the UiSelector class to locate elements. In Appium you send the Java code, as a string, to the server, which executes it in the application’s environment, returning the element or elements.
Android View Tag (Espresso only)Locate an element by its view tag
Android Data Matcher (Espresso only)Locate an element using Espresso DataMatcher
IOS UIAutomationWhen automating an iOS application, Apple’s Instruments framework can be used to find elements


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

SeleniumWebdriver Automation Testing Interview Questions:

 
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

Monday 15 November 2021

Top 21 Java Coding Interview Question and Answers for QA - SDET - Testers - SDE ?

 



 Pre-requisite: How to install JDK and set Java Home path in Windows and MacOs ?

Ans: Click here for Steps

Java Interview question Set-1:
SET-01 1-10

Java Interview question Set-2:

SET-02 10-20

Java Interview question Set-3:

SET-03 21-30

11. How to reverse the first half of Array?

public class revfirsthalfIntegerArray {

    public static void main(String[] args) {

        int[] arr= {10,2,5,4,6,9,5,3};


        int len=arr.length;


        for(int i=0; i<len/4;i++)

        {

            int t = arr[i]; 

            arr[i] = arr[len/2 - i - 1]; 

            arr[len/2 - i - 1] = t; 

        }


        for(int j=0; j<len; j++)

        {

            System.out.println(arr[j]);

        }

    }

}


12. What is ModeOfArray and write the code for it?


public static void modeofarray() {


int arr[] = {1,2,3,3,4,5};

int maxnumber=-1;

int maxapperance=-1;

int result=0;


for (int i=0;i<arr.length;i++) {

int count=0;

for (int j=0;j<arr.length;j++)

                             {

if (arr[i]==arr[j]) {

count++;

}

}

if (count > maxapperance) {

maxnumber=arr[i];

maxapperance=count;

}

}

System.out.println("+" +maxnumber);

}

==> Click=Here> Pipeline Script Fundamentals

==> Click Here for Installation=> How to install Jenkins with steps?
==> Click Here :   DevOps Related Posts


13.  How to find the maximum and minimum in an ARRAY?


Ans: Click Here For Answer




14. How to find the sum of all the digits?


public static int sumofdigits(int n) {

if (n==0) {

return 0;

}

return n%10+sumofdigits(n/10);

}


15. What is median in array, define the logic and write the code?



To calculate the median first we need to sort the list in ascending or descending order. If the number of elements are even, then the median will the average of two numbers in the middle. But the number is odd then the middle element of the array after sorting will be considered as the median










 public static void medianofarray() {


int arr[]= {1,2,3,4}; //array is already sorted so no need to sort again

int arr3[]= {1,2,3,4};


if (arr.length % 2 != 0)  //if number of elements are odd

                {

System.out.println("median of array is: " + arr[arr.length/2]);


}else {


System.out.println("median of array is: " + (arr[(arr.length/2)]+arr[(arr.length/2-1)])/2.0);


}

}


16. How to merge two array in Java?


public static void mergetwoarray() {

int arr1[]= {1,5,2,4};

int arr2[]= {5,3,8,7,9};


//sort both arrays

Arrays.sort(arr1);

Arrays.sort(arr2);

int resultarray[] = new int[arr1.length+arr2.length];


int i = 0,j = 0,k=0;


while(i<arr1.length && j<arr2.length) {

if (arr1[i]<arr2[j]) {

resultarray[k++]=arr1[i++];

}

else{

resultarray[k++]=arr2[j++];

}

}

while(i<arr1.length) {

resultarray[k++]=arr1[i++];

}

while(j<arr2.length) {

resultarray[k++]=arr2[j++];

}

for (int l=0;l<resultarray.length;l++) {

System.out.println(resultarray[l]);

}

}

17.  How to find duplicates element in an array?


Click Here For Answer


18. How to find the leader in an Array?


An element is leader if it is greater than all the elements to its right side.


public static void leaderinarray() {


int arrl[]= {1,2,4,3,8,6,7,1};


for (int i=0;i<arrl.length;i++) {

int j;

for ( j=i+1;j<arrl.length;j++) {


if (arrl[i]<arrl[j]) 

                                {

break;

}

}

if (j==arrl.length) {


System.out.println(arrl[i]);

}

}

}

  •    How to convert List to array and array to list?

          Click here for Answer

  •   How to remove a SubList from a List in Java ?

    AnsList.subList(int fromIndex, int toIndex).clear()

  • How to do Sorting of An Array?

    Click Here For Answer 

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

Check Selenium Interview Questions from 1 to 10 below:


Check Selenium-SDET-UIAutomation Questions set 11 to 20:
Qus Set - 11 to 20

Check Selenium-SDET-UIAutomation Questions set 21 to 30:
**********************

19.  How to Add/Join/Combine two list?


Click Here For Answers


20.  TASK: Let you have an input as "aabbBCccD" then the output should be "a2b3c3d1"

Try to find the logic and share in comments.

21. Revision :Find the second largest in an ARRAY?


public class firstsecodlargest {

public static void main(String[] args) {

int[] arr = {1,2,3,4,5,6};

int firstlargest=0;

int secondlargest=0;

int i=0;

int narr.length;

for (i=0;i<n;i++) 

{

if (arr[i]>firstlargest){

secondlargest=firstlargest;

firstlargest=arr[i];

}

}

System.out.println(firstlargest + "  " + secondlargest);


}}


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

**********

Java Interview question Set-1:
SET-01 1-10

Java Interview question Set-2:

SET-02 10-20

Java Interview question Set-3:

SET-03 21-30


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

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

All Time Popular Posts

Most Featured Post

Sorting with Examples & Time Complexity for SDET

  🔺 LinkedIn: https://www.linkedin.com/in/sidharth-shukla-77b53145/ 🔺 Telegram Group:  https://t.me/+FTf_NPb--GQ2ODhl Bubble Sort:    Bubb...