First 50 of 200 questions. Each one lists the choices, the correct answer, and an explanation. The checker at the top of this page saves progress in this browser when it is available.
Continue in the practice tool above to load more questions, 50 at a time.
Question 1Mobile application testing
In Appium, what does the term 'session' represent?
- A persistent database of previously located UI elements
- A screenshot captured at the start of each test
- A logical connection between the client and the automation server that hosts a single test run Correct answer.
- A compiled binary of the application under test
Explanation
An Appium session is created when a client sends desired capabilities to the server and represents one automation run against a device. All subsequent commands are routed within that session until it is deleted.
Question 2Mobile application testing
Which capability is used to specify the target mobile platform in Appium?
- automationName
- deviceOrientation
- platformName Correct answer.
- appPackage
Explanation
platformName tells the Appium server whether the session targets iOS or Android. It is one of the most fundamental desired capabilities.
Question 3Mobile application testing
What is the primary role of the Appium server?
- It listens for client commands over HTTP and translates them into device-specific automation actions Correct answer.
- It stores test reports for later analysis
- It replaces the operating system on the device under test
- It compiles test code into native binaries for the device
Explanation
The Appium server receives WebDriver-style commands via HTTP and forwards them to the appropriate driver, which executes them on the device. It acts as a middle layer between client and device.
Question 4Mobile application testing
Which locator strategy in Appium allows finding elements by their accessibility label on both Android and iOS?
- id
- class name
- xpath
- accessibility id Correct answer.
Explanation
The accessibility id strategy maps to content descriptions on Android and accessibility identifiers on iOS, making it cross-platform and resilient to UI changes.
Question 5Mobile application testing
A tester wants to interact with a native mobile element. Which context must be active?
- WEBVIEW_chrome
- NATIVE_APP or WEBVIEW_chrome interchangeably
- FLUTTER
- NATIVE_APP Correct answer.
Explanation
Native UI elements are exposed only in the NATIVE_APP context. Webviews require switching to a WEBVIEW context before interacting with web content.
Question 6Mobile application testing
Which command switches the automation context to a webview in Appium?
- driver.context('WEBVIEW_com.example') Correct answer.
- driver.switchTo().frame('WEBVIEW_com.example')
- driver.activateApp('WEBVIEW_com.example')
- driver.setContext('NATIVE_APP')
Explanation
The context command changes the active context for the session. It accepts the context name obtained from getContextHandles.
Question 7Mobile application testing
What is the purpose of desired capabilities in Appium?
- They determine the test report format
- They specify the test execution order
- They configure the session, telling the server which device, platform, and app to automate Correct answer.
- They define the assertions used in the test
Explanation
Desired capabilities are key-value pairs sent when creating a session to describe the target environment. The server uses them to select and configure the appropriate device and driver.
Question 8Mobile application testing
Which Appium command is used to find a single element on the screen?
- findElements
- getElementAttribute
- getPageSource
- findElement Correct answer.
Explanation
findElement returns the first element matching the locator and throws if none is found. findElements returns a list and does not throw when empty.
Question 9Mobile application testing
A test taps a button using touch actions. Which class is commonly used for touch gestures in Appium?
- TouchAction Correct answer.
- KeyAction
- ScrollAction
- MouseAction
Explanation
TouchAction builds sequences of touch gestures such as tap, press, and move. These sequences are performed against the device.
Question 10Mobile application testing
Which method performs a swipe gesture using the W3C actions API in Appium?
- driver.perform(actions) with a pointer input sequence Correct answer.
- driver.swipeLegacy()
- driver.pressKey()
- driver.tapElement()
Explanation
The W3C actions API builds a sequence of pointer actions (move, down, move, up) and executes them via perform. This is the modern cross-platform approach.
Question 11Mobile application testing
What does the getPageSource command return in Appium?
- An XML representation of the current UI hierarchy Correct answer.
- A screenshot of the current screen
- The current device orientation
- The list of installed packages
Explanation
getPageSource returns the UI hierarchy as XML, which is useful for debugging locators. It reflects the currently active context.
Question 12Mobile application testing
Which driver is used by Appium to automate Android applications?
- UiAutomator2 Correct answer.
- Windows
- Mac2
- XCUITest
Explanation
UiAutomator2 is the standard Appium driver for Android automation. It uses the UiAutomator framework on the device.
Question 13Mobile application testing
Which driver is used by Appium to automate iOS applications?
- Espresso
- UiAutomator2
- Gecko
- XCUITest Correct answer.
Explanation
XCUITest is the Appium driver for iOS, built on Apple's XCTest framework. It requires WebDriverAgent to be running on the device.
Question 14Mobile application testing
A tester needs to verify that a text field contains a specific value. Which command retrieves the element's text?
- getValue
- getText Correct answer.
- getAttribute
- getSource
Explanation
getText returns the visible text of an element. It is the standard command for reading displayed content.
Question 15Mobile application testing
What is the purpose of the implicit wait in Appium?
- To retry the entire test on failure
- To tell the driver to poll for an element for a set duration before failing Correct answer.
- To pause the test unconditionally for a fixed time
- To wait for the app to install
Explanation
An implicit wait sets a default timeout during which the driver keeps searching for elements. It applies to all subsequent find operations.
Question 16Mobile application testing
Which command is used to hide the on-screen keyboard in Appium?
- dismissKeyboard
- closeKeyboard
- hideKeyboard Correct answer.
- pressBack
Explanation
hideKeyboard dismisses the soft keyboard if it is visible. It is useful when the keyboard obscures elements.
Question 17Mobile application testing
A test needs to scroll down until a specific element becomes visible. Which approach is most robust?
- Use getPageSource to check for the element and then stop
- Use a scroll gesture combined with a wait for the element to exist Correct answer.
- Rely on the element being visible without scrolling
- Use a fixed sleep before scrolling
Explanation
Combining scrolling with an explicit wait for the element to exist handles variable load times and list lengths. This is more reliable than fixed delays.
Question 18Mobile application testing
What does the 'app' capability specify in an Appium session?
- The path or URL to the application binary to install and launch Correct answer.
- The name of the test suite
- The device orientation
- The port the server listens on
Explanation
The app capability points to the app binary that should be installed and launched in the session. It can be a local path or a remote URL.
Question 19Mobile application testing
Which capability is used to launch an already installed Android app by package name?
- bundleId
- appActivity
- app
- appPackage Correct answer.
Explanation
appPackage specifies the Android package to launch when the app is already installed. It is typically paired with appActivity.
Question 20Mobile application testing
What is the purpose of the 'noReset' capability?
- To preserve app state between sessions instead of reinstalling or clearing data Correct answer.
- To skip the initial splash screen
- To prevent screenshots from being captured
- To disable network access during the test
Explanation
noReset keeps the app's data and state between sessions, avoiding a fresh install each run. This speeds up tests but can cause state leakage.
Question 21Mobile application testing
A tester wants to verify that an element is displayed before tapping it. Which command should be used?
- isDisplayed Correct answer.
- isSelected
- getLocation
- isEnabled
Explanation
isDisplayed returns whether the element is visible on screen. This is the correct check before interacting with it.
Question 22Mobile application testing
What is the purpose of the WebDriverAgent in iOS automation with Appium?
- It manages Android emulators
- It runs on the device and exposes the UI automation interface that Appium drives Correct answer.
- It replaces Xcode during test execution
- It compiles the app under test
Explanation
WebDriverAgent is a WebDriver server that runs on the iOS device and allows Appium to control the UI. It bridges Appium commands to XCTest.
Question 23Mobile application testing
Which locator is generally preferred for cross-platform tests because it is stable across UI refactors?
- class name with index
- accessibility id Correct answer.
- name attribute
- XPath with absolute paths
Explanation
accessibility id is tied to the element's accessibility label, which tends to remain stable when the layout changes. Absolute XPath and positional locators break easily.
Question 24Mobile application testing
A test must run on both Android and iOS. Which practice best supports this?
- Use XPath based on each platform's exact hierarchy
- Use accessibility ids and platform-agnostic page objects with driver-specific capabilities Correct answer.
- Hardcode Android resource ids in all tests
- Write separate test code paths for every step
Explanation
Using accessibility ids and abstracting platform differences into page objects allows a single test to run on both platforms. Platform-specific capabilities are supplied at session creation.
Question 25Mobile application testing
What does the getContextHandles command return?
- A list of connected devices
- A list of context names available in the current session Correct answer.
- A list of installed applications
- A list of open windows on the host machine
Explanation
getContextHandles returns the context names such as NATIVE_APP and WEBVIEW_* that the session can switch to. It is used before calling context.
Question 26Mobile application testing
Which Appium concept allows a single test script to run on both Android and iOS by abstracting platform-specific automation details?
- The UiAutomator2 server
- The WebDriverAgent
- The driver abstraction layer Correct answer.
- The JSON Wire Protocol
Explanation
Appium's driver abstraction layer provides a unified WebDriver API that delegates commands to platform-specific drivers, enabling cross-platform test scripts. The JSON Wire Protocol is a transport format, not an abstraction for platform differences. WebDriverAgent and UiAutomator2 are platform-specific automation servers.
Question 27Mobile application testing
A tester wants to run the same test suite against multiple Android devices with different screen sizes. Which Appium feature best supports this without changing test code?
- Hardcoding coordinates for each device resolution
- Using the 'appium:platformVersion' capability to select devices
- Creating separate test scripts for each device model
- Using the 'appium:deviceName' capability to target each device Correct answer.
Explanation
The 'appium:deviceName' capability allows targeting a specific device or a matching device from a pool, so the same test code can run on different devices by changing capabilities. Hardcoding coordinates breaks on different screen sizes. Platform version does not select device models, and separate scripts defeat the purpose of reusable tests.
Question 28Mobile application testing
Which Appium strategy is recommended for locating elements in a native mobile app when the app's accessibility identifiers are properly set?
- Class name with index
- XPath with absolute paths
- Accessibility ID Correct answer.
- ID with dynamic resource names
Explanation
Accessibility ID uses the accessibility identifier (contentDescription on Android, accessibilityIdentifier on iOS), which is stable and recommended for cross-platform tests. Absolute XPath is brittle, class name with index is fragile, and dynamic resource names may change between builds.
Question 29Mobile application testing
A test needs to perform a long press on an element. Which Appium action sequence correctly implements this using the W3C Actions API?
- A pointer move to the element, pointer down, pointer up immediately
- A pointer move to the element, pointer down, pointer cancel
- A pointer move to the element, pointer down, pause for the desired duration, pointer up Correct answer.
- A pointer move to the element, pointer up, pointer down
Explanation
A long press requires pressing down, holding for a duration (pause), and releasing. The pause action creates the hold time. Immediate up is a tap, cancel aborts the gesture, and up before down is invalid.
Question 30Mobile application testing
Which Appium capability is used to specify the path to the mobile application file to be installed and launched?
- bundleId
- appActivity
- appPackage
- app Correct answer.
Explanation
The 'app' capability points to the app binary (e.g., .apk or .ipa) that Appium installs and launches. appPackage and appActivity are Android-specific for launching an installed app, and bundleId is iOS-specific for an installed app.
Question 31Mobile application testing
What is the primary purpose of the Appium Settings app on Android?
- To modify device settings that affect automation, such as animations Correct answer.
- To record test execution videos
- To install the application under test
- To provide a graphical interface for writing tests
Explanation
Appium Settings is a helper app that allows the Android driver to change system settings like animation scales and locale during a session. It does not install the app under test, record videos, or provide a test-writing UI.
Question 32Mobile application testing
A tester wants to capture a screenshot of the current screen during a failed test. Which Appium command should be used?
- getWindowSize
- getScreenshotAs Correct answer.
- getPageSource
- getSessionDetails
Explanation
The getScreenshotAs method captures the current screen as an image. getPageSource returns the UI hierarchy, getWindowSize returns dimensions, and getSessionDetails returns session metadata.
Question 33Mobile application testing
Which Appium API is used to retrieve the current orientation of the device?
- getRotation
- getDeviceOrientation
- getOrientation Correct answer.
- getScreenOrientation
Explanation
The getOrientation method returns the current orientation (e.g., PORTRAIT or LANDSCAPE). The other method names are not part of the standard Appium API.
Question 34Mobile application testing
A test needs to interact with a native alert dialog on iOS. Which Appium command is used to accept the alert?
- driver.getAlertText()
- driver.switchTo().alert().accept() Correct answer.
- driver.acceptAlert()
- driver.dismissAlert()
Explanation
Appium follows the WebDriver alert interface; you switch to the alert and call accept() to accept it. The other methods are not part of the standard Appium API for alerts.
Question 35Mobile application testing
Which Appium capability allows the test to start the app with a specific activity or intent on Android?
- intentAction
- appPackage
- activityName
- appActivity Correct answer.
Explanation
The 'appActivity' capability specifies the Android activity to launch. appPackage specifies the package, intentAction is not a standard capability for this purpose, and activityName is not a standard Appium capability.
Question 36Mobile application testing
A tester wants to ensure that a test fails if an element is not present within a certain time. Which Appium feature should be used?
- Implicit wait
- Thread.sleep
- Page load timeout
- Explicit wait Correct answer.
Explanation
Explicit waits allow waiting for a specific condition (e.g., element presence) with a timeout, and they fail with a timeout exception if the condition is not met. Implicit wait applies globally to all element searches, Thread.sleep is a fixed delay, and page load timeout is for page loading.
Question 37Mobile application testing
Which Appium command is used to retrieve the current context (e.g., NATIVE_APP or WEBVIEW) in a hybrid app?
- getContext
- getCurrentContext Correct answer.
- getWindowHandle
- getContextHandles
Explanation
getCurrentContext returns the current context. getContext is not a standard command, getContextHandles returns all available contexts, and getWindowHandle is for browser windows.
Question 38Mobile application testing
A test needs to verify that a specific text is present on the screen. Which Appium command is most appropriate for retrieving all visible text?
- getPageSource Correct answer.
- getAllVisibleText
- findElement(By.xpath("//*[@text]"))
- getText on the root element
Explanation
getPageSource returns the full UI hierarchy as XML/HTML, which can be parsed to check for text presence. The other options are either not standard commands or less reliable for retrieving all text.
Question 39Mobile application testing
Which Appium capability is used to set the language and locale for the app under test on Android?
- language
- androidLanguage
- locale Correct answer.
- appLocale
Explanation
The 'locale' capability sets the locale for the app on Android (and iOS). 'language' is not a standard capability, and the other names are not standard.
Question 40Mobile application testing
A tester wants to simulate a device shaking gesture. Which Appium command should be used?
- shake Correct answer.
- simulateShake
- deviceShake
- shakeDevice
Explanation
The shake command simulates a device shake. The other names are not standard Appium commands.
Question 41Mobile application testing
Which Appium strategy is best for locating an element that has no unique ID or accessibility identifier but has a stable text label?
- ID
- Class name
- XPath with contains(text(), 'label') Correct answer.
- Accessibility ID
Explanation
When no unique ID or accessibility identifier exists, XPath using text content can locate the element reliably if the text is stable. Class name is not unique, and ID/accessibility ID are unavailable.
Question 42Mobile application testing
What is the purpose of the 'autoGrantPermissions' capability on Android?
- To disable permission checks in the app
- To pre-grant permissions during app installation
- To grant permissions only for the app under test
- To automatically accept all runtime permission dialogs Correct answer.
Explanation
autoGrantPermissions automatically accepts runtime permission dialogs that appear during the test, simplifying automation. It does not disable permission checks or pre-grant only during installation.
Question 43Mobile application testing
A test needs to run on a real iOS device. Which additional component must be configured for Appium to communicate with the device?
- UiAutomator2 server
- Appium Settings app
- WebDriverAgent signed with a development certificate Correct answer.
- Chromedriver
Explanation
For real iOS devices, WebDriverAgent must be built and signed with a valid development certificate to run on the device. UiAutomator2 and Appium Settings are Android-specific, and Chromedriver is for web views.
Question 44Mobile application testing
Which Appium command is used to lock the device screen?
- deviceLock
- lock
- screenLock
- lockDevice Correct answer.
Explanation
The lockDevice command locks the device screen. The other names are not standard Appium commands.
Question 45Mobile application testing
A tester observes that a test passes on a small screen but fails on a large screen because an element is off-screen. Which Appium technique best addresses this?
- Disable animations
- Use the 'mobile: scroll' command to bring the element into view Correct answer.
- Increase the implicit wait timeout
- Use absolute XPath to locate the element
Explanation
Scrolling to the element ensures it is visible and interactable regardless of screen size. Increasing wait time does not make an off-screen element visible, absolute XPath does not solve visibility, and disabling animations does not affect element position.
Question 46Mobile application testing
Which Appium command is used to get the text of a toast message on Android?
- getText on the root element
- getToastMessage
- findElement(By.xpath("//android.widget.Toast")).getText() Correct answer.
- getPageSource
Explanation
Toast messages can be located by their class name (android.widget.Toast) and their text retrieved. getToastMessage is not standard, and getPageSource or root getText may not capture transient toasts reliably.
Question 47Mobile application testing
A test needs to verify that an element is enabled before clicking it. Which Appium command should be used?
- isClickable
- isEnabled Correct answer.
- isDisplayed
- isSelected
Explanation
isEnabled checks whether an element is enabled and can be interacted with. isDisplayed checks visibility, isClickable is not a standard WebDriver method, and isSelected checks selection state.
Question 48Mobile application testing
Which Appium command is used to set the value of an element, such as a text field, without using sendKeys?
- setText
- replaceValue
- type
- setValue Correct answer.
Explanation
The setValue command sets the value of an element directly. setText, replaceValue, and type are not standard Appium commands for this purpose.
Question 49Mobile application testing
A tester wants to run tests in parallel on multiple devices using Appium. Which component is required to manage multiple Appium sessions?
- Selenium Grid or Appium's built-in parallel support Correct answer.
- UiAutomator2
- Appium server with a single port
- WebDriverAgent
Explanation
Parallel testing requires a way to manage multiple sessions, such as Selenium Grid or Appium's parallel capabilities. A single port server cannot handle multiple sessions simultaneously. WebDriverAgent and UiAutomator2 are platform-specific drivers.
Question 50Mobile application testing
Which Appium capability is used to specify the path to the Chromedriver executable for webview automation on Android?
- webviewDriver
- chromedriverPath
- chromedriverBinary
- chromedriverExecutable Correct answer.
Explanation
The 'chromedriverExecutable' capability sets the path to the Chromedriver binary. The other names are not standard Appium capabilities.