1.
Name most recommended native locator in appium
Explanation
The most recommended native locator in Appium is accessibilityid. This locator allows for easy identification and interaction with elements based on their accessibility properties, such as labels or descriptions. It is considered a best practice to use accessibilityid as it provides a reliable and efficient way to locate elements in mobile applications, especially for testing purposes.
2.
How to perform multiple touch action in appium
Explanation
The correct answer is MultiTouchAction. The MultiTouchAction class in Appium allows users to perform multiple touch actions simultaneously on a mobile device. This is useful for scenarios where multiple fingers need to be used, such as pinch zoom or swipe gestures. By using the MultiTouchAction class, users can create a sequence of touch actions and perform them all at once on the device's screen. This provides a more realistic and efficient way of interacting with mobile applications during automated testing.
3.
Mention the method/method's with which you can swipe in App.
Explanation
To swipe in an app, you can use the methods "press" and "moveTo". The "press" method is used to simulate a touch or click on the screen, while the "moveTo" method is used to move the touch or click to a specific location on the screen. By combining these two methods, you can simulate a swipe gesture in the app.
4.
Provide snippet for long press using touch action
Explanation
The provided code snippet demonstrates how to perform a long press action using the TouchAction class in Appium. It creates a new TouchAction object with the driver, then uses the longPress method to specify the element's center as the point to perform the long press action. Finally, the release and perform methods are called to release the long press and perform the action.
5.
List minimum capabilities required for automating native app
Explanation
The minimum capabilities required for automating a native app are deviceName, platformName, and app. The deviceName capability specifies the name of the device or emulator on which the app will be tested. The platformName capability specifies the platform or operating system of the device, such as Android or iOS. The app capability specifies the location or path of the app file that needs to be installed on the device for testing. These capabilities are essential for setting up the testing environment and ensuring that the app can be properly installed and executed on the targeted device.
6.
Which of the below method returning "point"
Correct Answer
A. GetLocation()
Explanation
The method getLocation() is the correct answer because it returns the location of an object as a Point. The other methods getSize() and getCoordinates() do not return "point" specifically, and the expression getRect().getPoint().x is not a method but an expression that accesses the x-coordinate of a point in a rectangle.
7.
Which of the following locator type is not part of "iOSXCUITFindBy"
Correct Answer
A. Xpath
Explanation
The correct answer is xpath. This is because the "iOSXCUITFindBy" locator type is specific to iOS app testing and does not include the "xpath" locator type, which is commonly used in web testing.
8.
Dimension frame =driver.manage().window().getSize();
Point p1 = new Point(frame.width, frame.height);
where will be p1 located in device screen
Correct Answer
C. Botton right corner
Explanation
The code snippet is using the `getSize()` method to get the dimensions of the device screen and storing it in the `frame` variable. Then, a new `Point` object `p1` is created with the `width` and `height` values from the `frame` object. Since the `p1` point is created using the `frame` dimensions, it will be located at the bottom right corner of the device screen.
9.
Which of the following is not part of Tap method
Correct Answer
B. PressOption.point
10.
Driver.findElement(By.cssSelector("abc"));
will above locator strategy valid for native apps
Correct Answer
B. False
Explanation
The given locator strategy, By.cssSelector("abc"), will not be valid for native apps. This is because the cssSelector method is used to locate elements on a web page, not in a native app. To locate elements in a native app, different locator strategies such as By.id, By.className, By.xpath, etc. should be used.