Hybrid Mobile Application Automation

If you get failed on recording / finding some elements on hybrid (webView) applications, you have to read this document first.

Open Mobile (Android / iOS) Project Settings. Use this capability in the project.

  • autoWebview → Boolean → true

 

autoWebview: Move directly into Webview context. Default is false

 

Java Example:

//Switch to Webview driver.context("WEBVIEW"); //return driver.context(contexts[1]); // choose the webview context Thread.sleep(2000); WebElement myWebViewElement = (WebElement) driver.findElement(By.xpath("YOUR-XPATH")); myWebViewElement.click(); //Switch to App driver.context("NATIVE_APP"); Thread.sleep(1000); WebElement myNativeAppElement = (WebElement) driver.findElement(By.xpath("YOUR-XPATH")); myNativeAppElement.click();

 

More information about automating hybrid apps:

https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/hybrid.md

 

More information about Android webpages and hybrid apps:

https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/chromedriver.md

 

More information about iOS WebKit Debug Proxy:

https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/web/ios-webkit-debug-proxy.md

 

More information and settings for hybrid applciations:
http://appium.io/docs/en/writing-running-appium/caps/