I have an android activity with webview.
However appium 1.4.16 cannot recognize this context.
How can i fix this?
myAndroidDriver.getContextHandles()
==> return list of size 1
I have an android activity with webview.
However appium 1.4.16 cannot recognize this context.
How can i fix this?
myAndroidDriver.getContextHandles()
==> return list of size 1
First you need to interact with webview, then web element.
Click on `webview -> driver.findElement(By.id(“wvBase”)).click(); then you can interact with web elements.
This is how i am doing in my hybrid app automation. Hope this will work in your case as well.
Is ur app targeted to which android platform? anything below 4.4.4 will not work with appium to detect Webview… actually this is not limitation from appium side, its limitation of UIAutomator, which appium uses under the hood. So you need to run ur script under selendroid mode.
Appium supports all API >=10, and if device’s API < 17 then it uses Selendroid mode, otherwise it uses android’s own UIAutomator framework. So point here, is WebView detection capability had been introduced to UIAutomator in API 4.4.4, so UIAUtomatorviewer can not detect web view if ur application’s targeted api is below 4.4.4, so Appium will not work. In such cases selendroid instrumentation will work to detect web view.
Thanks,
Priyank Shah
Thanks
setWebContentsDebuggingEnabled = true;
or is in addition to that flag?
What does “selendroid mode” really means?
appium not using UIAutomator? Will this affect other tests I have?
I have tried this before, but the code execution fails
when I add:
capabilities.setCapability(“automationName”, “Selendroid”);
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c /Users/eladb/MyWorkspace/sdk/build-tools/android-4.4/aapt dump badging
ERROR: no dump file specified
) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.54 seconds
Build info: version: ‘2.47.1’, revision: ‘unknown’, time: ‘2015-07-30 11:02:44’
System info: host: ‘eladb-macbookpro.roam.corp.google.com’, ip: ‘100.105.45.192’, os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘10.11.2’, java.version: ‘1.8.0_25’
Driver info: com.waze.mobileautomation.common.android.MyAndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:242)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:37)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:160)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:168)
Thanks,
Priyank Shah
can u try “aapt dumpsys badging ‘APK location’” from command line. I guess ur apk might get corrupted.