Unit 2: Appium Project - Practice Quiz
1 What is the main purpose of Desired Capabilities in Appium?
2 Which capability identifies the mobile operating system used for a test?
3 Which capability is commonly used to specify the name of the device or emulator?
4
What does the automationName capability specify?
5 What is a vendor prefix in Appium capability names?
6 Which prefix is commonly used for Appium-specific capabilities?
7 Why does Appium use a vendor prefix for some capabilities?
8 What is Maven primarily used for in a Java Appium project?
9 Which file commonly contains Maven project configuration?
10 Where is the Appium Java client dependency usually added in a Maven project?
11 Which command is commonly used to compile a Maven project?
12 What does an Appium driver session represent?
13 Which object is commonly used to control an Android application in an Appium Java test?
14 What is required before a Java program can start an Appium driver session?
15 Which method is commonly used to close an Appium driver session?
16 What is the purpose of an Options class in Appium?
17 Which class is commonly used to define Android Appium options?
18
What does the Android appPackage identify?
19
What does the Android appActivity identify?
20 What is an Android Virtual Device, or AVD?
21 A test must run on an Android device using the UiAutomator2 automation engine. What is the primary role of the desired capabilities supplied when the session is created?
22
A Java test requests platformName=Android and appium:automationName=UiAutomator2. When does Appium normally use these values?
23
Two connected Android devices are available, but a test must run on one specific device. Which capability should be set to the identifier reported by adb devices?
appium:deviceName
appium:automationName
appium:platformVersion
appium:udid
24 Which capability set correctly follows the W3C WebDriver vendor-prefix rules for an Appium Android session?
appium:platformName, automationName, deviceName
platformName, automationName, deviceName
appium:platformName, appium:automationName, deviceName
platformName, appium:automationName, appium:deviceName
25
Why does Appium use the appium: prefix for capabilities such as appium:appPackage?
26
A raw W3C session request includes deviceName without a vendor prefix, and the server rejects it as a non-standard capability. Which change addresses the problem?
mobile:deviceName
webdriver:deviceName
android:deviceName
appium:deviceName
27
A new Maven-based Appium project compiles production code but ignores tests placed in a custom tests directory. Where should the test classes normally be moved?
src/main/java
src/test/java
target/test/java
src/main/resources
28
A Java class imports io.appium.java_client.android.AndroidDriver, but Maven reports that the package does not exist. Which pom.xml change most directly resolves the issue?
29
A Maven project uses JUnit 5, but mvn test reports zero tests even though the test classes compile. Which component should be checked for a version that supports JUnit 5 discovery?
30
Appium is running locally on port 4723, and valid Android options have already been configured. Which statement creates an Android driver session?
new AndroidDriver(new URL("http://127.0.0.1:4723"))
options.connect(new URL("http://127.0.0.1:4723"), AndroidDriver.class)
new AndroidDriver(new URL("http://127.0.0.1:4723"), options)
AndroidDriver.start(new URL("http://127.0.0.1:4723"), options)
31
A test creates an AndroidDriver successfully but leaves the Appium session active after every test run. Which action should be performed during teardown?
driver.resetInputState()
driver.navigate().refresh()
driver.quit()
driver.close()
32
A Java program receives Connection refused immediately when constructing AndroidDriver. The options are valid and the device is connected. What should be checked first?
Test
33 Which Java configuration appropriately uses the typed options approach for a UiAutomator2 session?
new ChromeOptions().setDeviceName("Pixel_API_34").setAppPackage("com.example")
new FirefoxOptions().setDeviceName("Pixel_API_34").setAppPackage("com.example")
new SafariOptions().setDeviceName("Pixel_API_34").setAppPackage("com.example")
new UiAutomator2Options().setDeviceName("Pixel_API_34").setAppPackage("com.example")
34
A test uses UiAutomator2Options and must install an APK located at /apps/demo.apk. Which configuration is appropriate?
options.setAppPackage("/apps/demo.apk")
options.setAppActivity("/apps/demo.apk")
options.setPlatformVersion("/apps/demo.apk")
options.setApp("/apps/demo.apk")
35
A project replaces DesiredCapabilities with UiAutomator2Options. What is a practical advantage of this change?
36 The target application is open in the foreground on a connected device. Which command is most useful for obtaining the currently focused package and activity?
adb shell input keyevent | grep -E 'mCurrentFocus|mFocusedApp'
adb shell dumpsys window | grep -E 'mCurrentFocus|mFocusedApp'
adb shell getprop | grep -E 'mCurrentFocus|mFocusedApp'
adb shell pm list packages | grep -E 'mCurrentFocus|mFocusedApp'
37
The output contains com.example.shop/.MainActivity. How should these values be assigned in UiAutomator2Options?
setAppPackage("com.example.shop.MainActivity") and setAppActivity(".")
setAppPackage(".MainActivity") and setAppActivity("com.example.shop")
setAppPackage("com.example.shop") and setAppActivity(".MainActivity")
setAppPackage("com.example") and setAppActivity("shop.MainActivity")
38 A test launches the correct package but fails because the configured activity is not exported or is only a temporary splash activity. What is the best next diagnostic action?
39 No Android emulator is running when the test starts. Which UiAutomator2 option can tell Appium to launch an existing Android Virtual Device automatically?
options.setAppPackage("Pixel_API_34")
options.setPlatformVersion("Pixel_API_34")
options.setAvd("Pixel_API_34")
options.setUdid("Pixel_API_34")
40 Appium starts the requested AVD, but the emulator boots too slowly and session creation times out. Which capability should be increased?
appium:androidInstallTimeout
appium:newCommandTimeout
appium:uiautomator2ServerInstallTimeout
appium:avdLaunchTimeout
41 A test must install an Android APK, reset application data before each test, and avoid reinstalling the APK between tests in the same suite. Which capability combination best represents this requirement?
42
A remote Appium server receives a session request containing platformName: "Android", deviceName: "emulator-5554", and an Android-specific application identifier. The server rejects the request because the application identifier is not recognized. What is the most likely cause?
43
A session request specifies both browserName: "Chrome" and app: "/tmp/application.apk". The test is intended to automate a native Android application. Which correction is most appropriate?
browserName and retain the application capability
browserName to the application package name
platformName from the request
browserName with the APK path
44
A test creates a session with appium:appPackage and appium:appActivity, but the application is already installed under a different build variant. The session starts the wrong application. Which capability design best prevents this ambiguity?
appium:app
deviceName and omit application identifiers
appium:noReset to true
appium:automationName to UiAutomator2
45
Why does a W3C-compliant Appium session commonly use appium:deviceName instead of an unprefixed deviceName?
46
A Java client sends automationName without a prefix and the server silently ignores it, selecting a default automation engine. Which explanation is most accurate?
47
A client library automatically prefixes Appium capabilities when building a W3C payload. A developer manually supplies appium:appPackage as the map key as well. What risk should be checked first?
48 A Maven Appium project compiles on one machine but fails on another because the compiler uses an older Java release. Which project-level change most reliably makes the build reproducible?
maven-compiler-plugin source and target properties
pom.xml
src/test to src/main
49 A project includes Appium Java Client version 8 and Selenium version 3 explicitly. Dependency resolution produces method errors at runtime. What is the strongest corrective action?
50
A Maven test uses AndroidDriver, but Maven reports that the class cannot be found even though the Java file imports it correctly. The dependency tree shows the Appium client only under the runtime profile. What should be changed?
AndroidTestDriver
51
A Java test creates an AndroidDriver in a setup method and calls driver.quit() in teardown. When session creation fails before assignment, teardown throws a null-reference error and hides the original failure. Which design addresses this correctly?
quit() twice to guarantee cleanup
52
An Appium server is reachable at http://127.0.0.1:4723, but the Java client is configured with http://127.0.0.1:4723/wd/hub and receives a 404 response from a modern server. What is the most likely correction?
http://127.0.0.1:4723
5554 instead of port 4723
/androidDriver to the server URL
53
Two Android emulators run simultaneously, and both tests use deviceName: "emulator". Sessions intermittently attach to the wrong device. Which capability is most important to make the target deterministic?
udid
appActivity value
54
A test uses UiAutomator2Options, sets setAppPackage("com.example.shop"), and sets setAppActivity(".MainActivity"). The server rejects the request because no automation engine is selected. Which addition is required?
setBrowserName("Android")
setAutomationName("UiAutomator2")
setDeviceName("UiAutomator2")
setPlatformName("Java")
55
A developer passes UiAutomator2Options to AndroidDriver, but also maintains a separate capabilities map containing a conflicting appium:appActivity. Which practice best avoids nondeterministic session configuration?
56
An options-based session launches the APK but fails to locate the startup activity because the activity name is relative. Which value is valid when the package is com.example.shop and the activity class is com.example.shop.ui.HomeActivity?
HomeActivity
.ui.HomeActivity
com.example.ui.HomeActivity
/ui/HomeActivity
57
The foreground activity command reports com.example.shop/.ui.HomeActivity, while the manifest declares a package namespace and a different application ID. Which values should be used for Appium launch capabilities?
58
After launching an app manually, adb shell dumpsys window windows shows the launcher as the focused window instead of the expected app. What is the most defensible conclusion?
android
59 A CI job must launch an Android Virtual Device without a graphical display and must fail if the emulator cannot boot fully. Which command pattern is most appropriate?
emulator -avd Pixel_API -no-window -no-boot-anim followed by a boot-completion check
appium --avd Pixel_API without starting an emulator process
adb start-server Pixel_API followed by a fixed one-second sleep
sdkmanager Pixel_API followed by adb install emulator
60 A script starts an emulator and immediately creates an Appium session. Session creation is flaky because ADB sees the device before Android framework boot completes. Which synchronization strategy is strongest?
sys.boot_completed until it reports readiness
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →