deepLink
Open a deep link URL in the mobile app based on the url and the app's package name (Android) or bundle ID (iOS).
Usage
browser.deepLink(link, appIdentifier, waitForLaunch)
Parameters
| Name | Type | Details |
|---|---|---|
link | string | The deep link URL that should be opened in the mobile app. It should be a valid deep link URL (e.g. myapp://path). If it's a universal deep link, which can be used for iOS, use the browser.url("your-url")-method. |
appIdentifier | string | The value of the package (Android) or bundleId (iOS) of the app that the deep link should open. |
waitForLaunchoptional | boolean | Whether to wait for the app to launch after opening the deep link. Default is true. ANDROID-ONLY |
Example
deeplink.js
it('should open a deep link for the WDIO native demo app', async () => {
// open the Drag tab with a deep link (this the bundleId for the iOS Demo App)
await browser.deepLink('wdio://drag', 'org.reactjs.native.example.wdiodemoapp');
// Or open the Drag tab with a deep link (this the package name for the Android Demo App)
await browser.deepLink('wdio://drag', 'com.wdiodemoapp');
// Or if you want to have it "cross-platform" you can use it like this
await browser.deepLink('wdio://drag', browser.isIOS ? 'org.reactjs.native.example.wdiodemoapp' : 'com.wdiodemoapp');
})
it('should open a deep link without waiting for the app to launch (Android)', async () => {
// Android-only: do not wait for the app to launch after opening the deep link
await browser.deepLink('wdio://drag', 'com.wdiodemoapp', false)
})
Support
note
Refer to the official Appium driver documentation to see which driver versions support this command.