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 create application source code
B. To design emulator screens
C. To describe the test session requirements
D. To store test results permanently

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

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

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

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

4 What does the automationName capability specify?

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

5 What is a vendor prefix in Appium capability names?

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

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

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

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 replace the Java compiler
B. To install applications automatically
C. To increase the emulator screen size
D. To avoid conflicts with standard capabilities

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

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

9 Which file commonly contains Maven project configuration?

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

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 Android manifest
C. Inside the emulator settings
D. Inside the Java main method

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

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

12 What does an Appium driver session represent?

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

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. AndroidDriver
B. JavaDriver
C. AndroidServer
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 completed test report
B. Appium server and session settings
C. A browser bookmark
D. A database table

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

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

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

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

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

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

18 What does the Android appPackage identify?

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

19 What does the Android appActivity identify?

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

20 What is an Android Virtual Device, or AVD?

Android: Launch Emulator Automatically Easy
A. A configuration for an Android emulator
B. A mobile application package
C. A type of Appium capability
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. Configure Maven to download the required Java dependencies
B. Specify the locators that Appium must use on each screen
C. Describe the requested session configuration to the Appium server
D. Define the assertions that Appium must evaluate during the test

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 server creates a new driver session
C. When Maven compiles the test classes
D. When the application generates its final report

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:udid
B. appium:platformVersion
C. appium:automationName
D. appium:deviceName

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. platformName, automationName, deviceName
B. appium: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 select dependencies from the Appium Maven repository
B. To distinguish Appium extensions from standard W3C capabilities
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 android:deviceName
C. Rename it to appium:deviceName
D. Rename it to webdriver: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/test/java
B. target/test/java
C. src/main/resources
D. src/main/java

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 Clean Plugin
B. Maven Resources Plugin
C. Maven Surefire Plugin
D. Maven Install 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"), options)
B. AndroidDriver.start(new URL("http://127.0.0.1:4723"), options)
C. new AndroidDriver(new URL("http://127.0.0.1:4723"))
D. options.connect(new URL("http://127.0.0.1:4723"), AndroidDriver.class)

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.navigate().refresh()
B. Call driver.close()
C. Call driver.resetInputState()
D. Call driver.quit()

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 test class name ends with the word Test
B. Whether the APK was compiled using Maven rather than Gradle
C. Whether the Appium server is listening at the configured URL
D. Whether every page element has a unique accessibility identifier

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 UiAutomator2Options().setDeviceName("Pixel_API_34").setAppPackage("com.example")
C. new SafariOptions().setDeviceName("Pixel_API_34").setAppPackage("com.example")
D. new FirefoxOptions().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.setApp("/apps/demo.apk")
B. options.setAppPackage("/apps/demo.apk")
C. options.setPlatformVersion("/apps/demo.apk")
D. options.setAppActivity("/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 provides typed setters for supported Android options
B. It discovers all application elements before execution
C. It removes the need for an installed Android driver
D. It starts the Appium server without any separate process

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") and setAppActivity(".MainActivity")
B. setAppPackage("com.example") and setAppActivity("shop.MainActivity")
C. setAppPackage(".MainActivity") and setAppActivity("com.example.shop")
D. setAppPackage("com.example.shop.MainActivity") and setAppActivity(".")

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. Increase Maven's compiler source level for the test project
B. Change the Appium server port to another available number
C. Inspect the focused activity after launching the app manually
D. Replace the device identifier with the Android model name

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.setAvd("Pixel_API_34")
B. options.setUdid("Pixel_API_34")
C. options.setAppPackage("Pixel_API_34")
D. options.setPlatformVersion("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:uiautomator2ServerInstallTimeout
B. appium:newCommandTimeout
C. appium:androidInstallTimeout
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": false}
B. {"app": "/builds/shop.apk", "noReset": false, "fullReset": true}
C. {"app": "/builds/shop.apk", "noReset": true, "fullReset": true}
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 platform name must be written as lowercase android
C. The capability uses an invalid or missing vendor prefix
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. Set browserName to the application package name
B. Remove platformName from the request
C. Replace browserName with the APK path
D. Remove browserName and retain the application capability

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. Use only deviceName and omit application identifiers
B. Set appium:automationName to UiAutomator2
C. Provide the exact APK through appium:app
D. Set appium:noReset to true

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 forces the driver to select an Android emulator
C. The prefix changes the capability value from text to JSON
D. The prefix converts the value into a secure credential

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 value is invalid because it must be numeric
B. The capability is treated as nonstandard without an Appium namespace
C. The capability is supported only for iOS sessions
D. The server requires the capability after the app path

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. Add the Appium server URL to pom.xml
B. Replace Maven dependencies with copied JAR files
C. Move test classes from src/test to src/main
D. Configure maven-compiler-plugin source and target properties

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. Remove all dependencies from the test scope
B. Add the Android SDK as a Maven dependency
C. Use a Selenium version compatible with the Appium client
D. Change the project artifact ID to the package name

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. Declare the Android SDK path in the Java package
B. Rename the class to AndroidTestDriver
C. Place the import statement inside the test method
D. Add the Appium client with test or compile visibility

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. Move session creation into the assertion method
B. Initialize the driver and quit only when it is non-null
C. Call quit() twice to guarantee cleanup
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. Append /androidDriver to the server URL
B. Change the URL to http://127.0.0.1:4723
C. Change the URL to the emulator's package identifier
D. Use port 5554 instead of port 4723

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. The exact emulator identifier as udid
B. A unique appActivity value
C. A longer implicit wait timeout
D. A different Maven artifact ID

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 setPlatformName("Java")
B. Set setDeviceName("UiAutomator2")
C. Set setAutomationName("UiAutomator2")
D. Set setBrowserName("Android")

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. Put the map into the Maven dependency section
B. Define each capability in one options object
C. Keep conflicting values and rely on server precedence
D. Set the activity only after the driver is constructed

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. com.example.ui.HomeActivity
B. HomeActivity
C. /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 application ID and the resolved foreground activity
C. The Gradle module name and the launcher label
D. The Java namespace and the manifest file name

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 package identifier must be changed to android
C. The emulator is necessarily using an iOS image
D. The app may have crashed, closed, or failed to launch

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. appium --avd Pixel_API without starting an emulator process
B. sdkmanager Pixel_API followed by adb install emulator
C. emulator -avd Pixel_API -no-window -no-boot-anim followed by a boot-completion check
D. adb start-server Pixel_API followed by a fixed one-second sleep

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. Restart the Maven process after driver creation
B. Poll sys.boot_completed until it reports readiness
C. Increase the test assertion timeout only
D. Wait a fixed two seconds in every environment