Skip to content

Instantly share code, notes, and snippets.

@dpgraham
Last active June 28, 2018 16:47
Show Gist options
  • Save dpgraham/698b464a4cef376d6c2c93f0fdb00169 to your computer and use it in GitHub Desktop.
Save dpgraham/698b464a4cef376d6c2c93f0fdb00169 to your computer and use it in GitHub Desktop.
Android Instant Apps
// Call the method
await driver.execute("mobile: deepLink", {url: 'https://www.realtor.com/realestateandhomes-search/San-Jose_CA', package: 'com.move.realtor'});
// If instant apps are enabled on this device, we should be able to switch
// to a native context and find elements
await driver.source().should.eventually.match(/com\.move\.realtor/);
// Check that we can find a native element and interact with it
const btn = await driver.elementsByXPath('//android.widget.Button');
btn.length.should.be.above(0);
await btn[0].click();
@dpgraham
Copy link
Author

The documentation for the Java execute method is here: http://appium.github.io/java-client/io/appium/java_client/ExecutesMethod.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment