Mobile devices come in many screen sizes. Why must testers check the app on different screen sizes?
Think about how the app looks and works on phones vs tablets.
Different screen sizes can change how content fits and how users interact. Testing ensures the app is usable and visually correct on all devices.
Consider this pseudocode that checks network state on a mobile device:
network = getNetworkState()
if network == 'wifi':
print('Connected to WiFi')
elif network == 'cellular':
print('Using mobile data')
else:
print('No network')If the device is in airplane mode, what will be printed?
Airplane mode disables all network connections.
In airplane mode, no network is available, so the else branch runs printing 'No network'.
You want to test that the app shows a warning message when battery level is below 15%. Which assertion is correct?
battery_level = 10 warning_displayed = app.checkLowBatteryWarning(battery_level) # Which assertion below is correct?
Remember the syntax for equality check in assertions.
Option A correctly uses '==' to check if warning_displayed is True. Option A uses assignment '=' which is invalid in assert. Options A and D check for False which is incorrect.
Here is code to detect if the device is in landscape mode:
def isLandscape(width, height):
if width > height:
return True
else
return FalseWhat is the bug?
Check syntax carefully after else statement.
The else statement is missing a colon at the end, causing a syntax error.
You want to automate tests for a mobile app on both Android and iOS using one codebase. Which framework is best?
Consider cross-platform support.
Appium supports both Android and iOS automation with one codebase. Espresso is Android-only, XCUITest is iOS-only, and JUnit is a general Java testing framework.