Unit 2: Appium Project - Practice Quiz

CSE379 — Mobile Automated Testing 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the main purpose of Desired Capabilities in Appium?

What are Desired Capabilities? Easy
A. To store test results permanently
B. To create application source code
C. To describe the test session requirements
D. To design emulator screens

2 Which capability identifies the mobile operating system used for a test?

What are Desired Capabilities? Easy
A. automationName
B. appActivity
C. deviceName
D. platformName

3 Which capability is commonly used to specify the name of the device or emulator?

What are Desired Capabilities? Easy
A. appPackage
B. platformName
C. appActivity
D. deviceName

4 What does the automationName capability specify?

What are Desired Capabilities? Easy
A. The application version
B. The Java package name
C. The emulator resolution
D. The automation engine

5 What is a vendor prefix in Appium capability names?

What is a vendor prefix and why Appium is using it? Easy
A. A name assigned to an emulator
B. A prefix identifying a tool-specific capability
C. A version number for Java
D. A suffix identifying a test method

6 Which prefix is commonly used for Appium-specific capabilities?

What is a vendor prefix and why Appium is using it? Easy
A. appium:
B. android:
C. test:
D. mobile:

7 Why does Appium use a vendor prefix for some capabilities?

What is a vendor prefix and why Appium is using it? Easy
A. To avoid conflicts with standard capabilities
B. To replace the Java compiler
C. To increase the emulator screen size
D. To install applications automatically

8 What is Maven primarily used for in a Java Appium project?

Create a Java Project using Maven Easy
A. Creating Android emulator images
B. Managing dependencies and building projects
C. Recording mobile screen videos
D. Replacing the Appium server

9 Which file commonly contains Maven project configuration?

Create a Java Project using Maven Easy
A. pom.xml
B. build.apk
C. appium.java
D. settings.json

10 Where is the Appium Java client dependency usually added in a Maven project?

Create a Java Project using Maven Easy
A. Inside the dependencies section
B. Inside the Java main method
C. Inside the emulator settings
D. Inside the Android manifest

11 Which command is commonly used to compile a Maven project?

Create a Java Project using Maven Easy
A. mvn compile
B. mvn emulator
C. mvn launch
D. mvn install-app

12 What does an Appium driver session represent?

Start Driver Session from the Java Program Easy
A. A Java dependency download
B. A saved copy of the application
C. A list of emulator screenshots
D. A connection between the test and the app

13 Which object is commonly used to control an Android application in an Appium Java test?

Start Driver Session from the Java Program Easy
A. JavaDriver
B. AndroidServer
C. AndroidDriver
D. MobileSession

14 What is required before a Java program can start an Appium driver session?

Start Driver Session from the Java Program Easy
A. A browser bookmark
B. A database table
C. Appium server and session settings
D. A completed test report

15 Which method is commonly used to close an Appium driver session?

Start Driver Session from the Java Program Easy
A. stopAppium()
B. closeSession()
C. quit()
D. endDriver()

16 What is the purpose of an Options class in Appium?

Create Driver Session using Options Class Easy
A. To define session settings in an object
B. To create an APK file
C. To start the Android operating system
D. To compile the Java project

17 Which class is commonly used to define Android Appium options?

Create Driver Session using Options Class Easy
A. MobileAppOptions
B. EmulatorDriverOptions
C. AndroidTestOptions
D. UiAutomator2Options

18 What does the Android appPackage identify?

Android: How to Get appPackage and appActivity? Easy
A. The emulator device name
B. The Appium server port
C. The package name of the application
D. The first screen title

19 What does the Android appActivity identify?

Android: How to Get appPackage and appActivity? Easy
A. The Android API level
B. The emulator network address
C. The activity used to start the application
D. The application package owner

20 What is an Android Virtual Device, or AVD?

Android: Launch Emulator Automatically Easy
A. A configuration for an Android emulator
B. A type of Appium capability
C. A mobile application package
D. A Java testing framework

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?

What are Desired Capabilities? Medium
A. Define the assertions that Appium must evaluate during the test
B. Specify the locators that Appium must use on each screen
C. Configure Maven to download the required Java dependencies
D. Describe the requested session configuration to the Appium server

22 A Java test requests platformName=Android and appium:automationName=UiAutomator2. When does Appium normally use these values?

What are Desired Capabilities? Medium
A. When the test searches for its first element
B. When the application generates its final report
C. When Maven compiles the test classes
D. When the server creates a new driver session

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?

What are Desired Capabilities? Medium
A. appium:deviceName
B. appium:automationName
C. appium:platformVersion
D. appium:udid

24 Which capability set correctly follows the W3C WebDriver vendor-prefix rules for an Appium Android session?

What is a vendor prefix and why Appium is using it? Medium
A. appium:platformName, automationName, deviceName
B. platformName, automationName, deviceName
C. appium:platformName, appium:automationName, deviceName
D. platformName, appium:automationName, appium:deviceName

25 Why does Appium use the appium: prefix for capabilities such as appium:appPackage?

What is a vendor prefix and why Appium is using it? Medium
A. To distinguish Appium extensions from standard W3C capabilities
B. To select dependencies from the Appium Maven repository
C. To convert Android capability names into Java properties
D. To encrypt capability values while they cross the network

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?

What is a vendor prefix and why Appium is using it? Medium
A. Rename it to mobile:deviceName
B. Rename it to webdriver:deviceName
C. Rename it to android:deviceName
D. Rename it to 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?

Create a Java Project using Maven Medium
A. src/main/java
B. src/test/java
C. target/test/java
D. 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?

Create a Java Project using Maven Medium
A. Add the Appium Java client as a dependency
B. Add the Android SDK as a Maven profile
C. Add the emulator image as a test resource
D. Add the Appium server as a build plugin

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?

Create a Java Project using Maven Medium
A. Maven Install Plugin
B. Maven Surefire Plugin
C. Maven Clean Plugin
D. Maven Resources Plugin

30 Appium is running locally on port 4723, and valid Android options have already been configured. Which statement creates an Android driver session?

Start Driver Session from the Java Program Medium
A. new AndroidDriver(new URL("http://127.0.0.1:4723"))
B. options.connect(new URL("http://127.0.0.1:4723"), AndroidDriver.class)
C. new AndroidDriver(new URL("http://127.0.0.1:4723"), options)
D. 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?

Start Driver Session from the Java Program Medium
A. Call driver.resetInputState()
B. Call driver.navigate().refresh()
C. Call driver.quit()
D. Call 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?

Start Driver Session from the Java Program Medium
A. Whether the APK was compiled using Maven rather than Gradle
B. Whether the Appium server is listening at the configured URL
C. Whether every page element has a unique accessibility identifier
D. Whether the test class name ends with the word Test

33 Which Java configuration appropriately uses the typed options approach for a UiAutomator2 session?

Create Driver Session using Options Class Medium
A. new ChromeOptions().setDeviceName("Pixel_API_34").setAppPackage("com.example")
B. new FirefoxOptions().setDeviceName("Pixel_API_34").setAppPackage("com.example")
C. new SafariOptions().setDeviceName("Pixel_API_34").setAppPackage("com.example")
D. 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?

Create Driver Session using Options Class Medium
A. options.setAppPackage("/apps/demo.apk")
B. options.setAppActivity("/apps/demo.apk")
C. options.setPlatformVersion("/apps/demo.apk")
D. options.setApp("/apps/demo.apk")

35 A project replaces DesiredCapabilities with UiAutomator2Options. What is a practical advantage of this change?

Create Driver Session using Options Class Medium
A. It discovers all application elements before execution
B. It starts the Appium server without any separate process
C. It provides typed setters for supported Android options
D. It removes the need for an installed Android driver

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?

Android: How to Get appPackage and appActivity? Medium
A. adb shell input keyevent | grep -E 'mCurrentFocus|mFocusedApp'
B. adb shell dumpsys window | grep -E 'mCurrentFocus|mFocusedApp'
C. adb shell getprop | grep -E 'mCurrentFocus|mFocusedApp'
D. 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?

Android: How to Get appPackage and appActivity? Medium
A. setAppPackage("com.example.shop.MainActivity") and setAppActivity(".")
B. setAppPackage(".MainActivity") and setAppActivity("com.example.shop")
C. setAppPackage("com.example.shop") and setAppActivity(".MainActivity")
D. 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?

Android: How to Get appPackage and appActivity? Medium
A. Inspect the focused activity after launching the app manually
B. Replace the device identifier with the Android model name
C. Increase Maven's compiler source level for the test project
D. Change the Appium server port to another available number

39 No Android emulator is running when the test starts. Which UiAutomator2 option can tell Appium to launch an existing Android Virtual Device automatically?

Android: Launch Emulator Automatically Medium
A. options.setAppPackage("Pixel_API_34")
B. options.setPlatformVersion("Pixel_API_34")
C. options.setAvd("Pixel_API_34")
D. 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?

Android: Launch Emulator Automatically Medium
A. appium:androidInstallTimeout
B. appium:newCommandTimeout
C. appium:uiautomator2ServerInstallTimeout
D. 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?

What are Desired Capabilities? Hard
A. {"app": "/builds/shop.apk", "noReset": true, "fullReset": true}
B. {"app": "/builds/shop.apk", "noReset": false, "fullReset": true}
C. {"app": "/builds/shop.apk", "noReset": true, "fullReset": false}
D. {"app": "/builds/shop.apk", "noReset": false, "fullReset": false}

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?

What are Desired Capabilities? Hard
A. The device name must contain the Android version
B. The capability uses an invalid or missing vendor prefix
C. The platform name must be written as lowercase android
D. The application identifier must be supplied as a URL

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?

What are Desired Capabilities? Hard
A. Remove browserName and retain the application capability
B. Set browserName to the application package name
C. Remove platformName from the request
D. Replace 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?

What are Desired Capabilities? Hard
A. Provide the exact APK through appium:app
B. Use only deviceName and omit application identifiers
C. Set appium:noReset to true
D. Set appium:automationName to UiAutomator2

45 Why does a W3C-compliant Appium session commonly use appium:deviceName instead of an unprefixed deviceName?

What is a vendor prefix and why Appium is using it? Hard
A. The prefix distinguishes Appium extensions from standard capabilities
B. The prefix converts the value into a secure credential
C. The prefix changes the capability value from text to JSON
D. The prefix forces the driver to select an Android emulator

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?

What is a vendor prefix and why Appium is using it? Hard
A. The server requires the capability after the app path
B. The value is invalid because it must be numeric
C. The capability is supported only for iOS sessions
D. The capability is treated as nonstandard without an Appium namespace

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?

What is a vendor prefix and why Appium is using it? Hard
A. The package name may be converted into an activity name
B. The emulator may be wiped before capability parsing
C. The server may interpret the value as a browser URL
D. The key may be double-prefixed or duplicated in serialization

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?

Create a Java Project using Maven Hard
A. Replace Maven dependencies with copied JAR files
B. Configure maven-compiler-plugin source and target properties
C. Add the Appium server URL to pom.xml
D. Move test classes from 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?

Create a Java Project using Maven Hard
A. Change the project artifact ID to the package name
B. Add the Android SDK as a Maven dependency
C. Use a Selenium version compatible with the Appium client
D. Remove all dependencies from the test scope

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?

Create a Java Project using Maven Hard
A. Place the import statement inside the test method
B. Rename the class to AndroidTestDriver
C. Add the Appium client with test or compile visibility
D. Declare the Android SDK path in the Java package

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?

Start Driver Session from the Java Program Hard
A. Call quit() twice to guarantee cleanup
B. Move session creation into the assertion method
C. Initialize the driver and quit only when it is non-null
D. Catch every exception and continue the test

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?

Start Driver Session from the Java Program Hard
A. Change the URL to http://127.0.0.1:4723
B. Use port 5554 instead of port 4723
C. Change the URL to the emulator's package identifier
D. Append /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?

Start Driver Session from the Java Program Hard
A. A longer implicit wait timeout
B. A different Maven artifact ID
C. The exact emulator identifier as udid
D. A unique 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?

Create Driver Session using Options Class Hard
A. Set setBrowserName("Android")
B. Set setAutomationName("UiAutomator2")
C. Set setDeviceName("UiAutomator2")
D. Set 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?

Create Driver Session using Options Class Hard
A. Set the activity only after the driver is constructed
B. Put the map into the Maven dependency section
C. Define each capability in one options object
D. Keep conflicting values and rely on server precedence

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?

Create Driver Session using Options Class Hard
A. HomeActivity
B. .ui.HomeActivity
C. com.example.ui.HomeActivity
D. /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?

Android: How to Get appPackage and appActivity? Hard
A. The APK filename and the emulator model
B. The Java namespace and the manifest file name
C. The Gradle module name and the launcher label
D. The application ID and the resolved foreground activity

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: How to Get appPackage and appActivity? Hard
A. The displayed activity is certainly the app's main activity
B. The emulator is necessarily using an iOS image
C. The app may have crashed, closed, or failed to launch
D. The package identifier must be changed to 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?

Android: Launch Emulator Automatically Hard
A. emulator -avd Pixel_API -no-window -no-boot-anim followed by a boot-completion check
B. appium --avd Pixel_API without starting an emulator process
C. adb start-server Pixel_API followed by a fixed one-second sleep
D. 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?

Android: Launch Emulator Automatically Hard
A. Poll sys.boot_completed until it reports readiness
B. Restart the Maven process after driver creation
C. Wait a fixed two seconds in every environment
D. Increase the test assertion timeout only