Appium 2

Switch to a webview context

Hard120 pts~45 min
  • Hybrid apps
  • Contexts
Practice app · Acme Mobile

A mobile app in a device frame. Elements expose data-accessibility-id (= aria-label) for AppiumBy.accessibilityId.

Test URL
/lab/appium-switch-to-a-webview-context

Your starter code already declares TEST_URL — never hardcode a host.

Objective

Switch from the native context into the embedded web view and interact with its web content.

Your task

  1. 1Log in as qa@target.dev / Test@123 via the accessibility ids "username", "password" and "login".
  2. 2Tap "allow" on the notification permission dialog (#permission-dialog) — the app is blocked until you answer it.
  3. 3Open the Web tab (accessibility id "tab-webview").
  4. 4List the contexts and switch to the WEBVIEW_* context.
  5. 5With web locators, assert #webview-heading reads "Web content" and tap #webview-button → "Support request sent".

Acceptance criteria

  • The web view heading is read
  • Support request is sent from inside the web view
  • The context is switched
  • At least 1 assertion passes

Fixtures

username
qa@target.dev
password
Test@123

Appium 2 · Appium · Waits & context