Hello,
I need to get the content desc of a webview loaded dynamically but I have two problems, first appium see two webviews and secondly appium don’t have the webview attributes.
App code :
final FrameLayout interstitial_container = (FrameLayout) findViewById(R.id.interstitial_container);
final WebView interstitial_web = new WebView(getApplicationContext());
interstitial_web.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT));
interstitial_web.loadUrl("http://example.com");
interstitial_web.setId(R.id.interstitial_webview);
interstitial_web.setContentDescription("breakfast");
interstitial_container.addView(interstitial_web, 0);
Appium source :
<android.widget.LinearLayout
index="2"
text=""
class="android.widget.LinearLayout"
package="com.evina.adsafetyfirstdemo"
content-desc=""
checkable="false"
checked="false"
clickable="false"
enabled="true"
focusable="false"
focused="false"
scrollable="false"
long-clickable="false"
password="false"
selected="false"
bounds="[0,1584][1080,1794]"
resource-id="com.evina.adsafetyfirstdemo:id/banner_bottom"
instance="1">
<android.webkit.WebView
index="0"
text=""
class="android.webkit.WebView"
package="com.evina.adsafetyfirstdemo"
content-desc=""
checkable="false"
checked="false"
clickable="false"
enabled="true"
focusable="false"
focused="false"
scrollable="false"
long-clickable="false"
password="false"
selected="false"
bounds="[0,1584][1080,1794]"
resource-id=""
instance="2">
<android.webkit.WebView
index="0"
text=""
class="android.webkit.WebView"
package="com.evina.adsafetyfirstdemo"
content-desc=""
checkable="false"
checked="false"
clickable="false"
enabled="true"
focusable="true"
focused="true"
scrollable="true"
long-clickable="false"
password="false"
selected="false"
bounds="[0,1584][1080,1794]"
resource-id=""
instance="3">
When I create a webview in Android XML template file, there is no problem so it seems that is a bug with webviews loaded dynamically.
Do you have an idea ?
For information I use UiAutomator2 with webdriver.io