webpage_clear_browsing_data
Clear cookies, localStorage, sessionStorage and/or the Cache Storage API for the page in the device browser (iOS Safari or Android Chrome, auto-detected). USE THIS to get a genuinely clean session between test cases: webpage_reload deliberately PRESERVES localStorage, so a reload keeps you logged in and carries app state into the next case. Every scope is VERIFIED by re-reading it afterwards and the result reports before/after counts, so a scope that could not be cleared says so instead of being assumed. On iOS cookies are removed one at a time through the Web Inspector (Page.deleteCookie), which reaches HttpOnly cookies that document.cookie cannot; on Android Network.clearBrowserCookies clears them in one call. HTTP cache: Android clears it via Network.clearBrowserCache (the browser reports no count, so it is returned as issued rather than verified); iOS has no Web Inspector equivalent, so only the Cache Storage API is cleared there and the HTTP cache is reported unsupported rather than silently skipped. DOES NOT LOG YOU OUT OF HTTP BASIC AUTH. Those credentials live in the browser credential store, which is none of these scopes — verified on qa.tms-hmpu.com, where an authenticated session shows 0 cookies, 0 localStorage and 0 sessionStorage. To force a Basic-auth challenge again, terminate the browser (ios_terminate_app com.apple.mobilesafari) and navigate afresh.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| udid | Yes | Device UDID / serial (iOS or Android) | |
| pageId | No | Target page/tab id — auto-picked when omitted | |
| scopes | No | What to clear (default: ["all"]). "all" = every scope this platform supports. | |
| socket | No | Android only: abstract unix socket name (default: chrome_devtools_remote) |