Dear folks,
I’m using Appium for doing Hybrid test on Android Device.
As somebody told me that UIAutomator 4.4. will interpret webview (and the H5 elements in webview) to view.
And, I did saw the button element in UIAutomator.bat tool, but whenever I ran my automation code, if I’m lucky I can find the element by using AppiumDriver.FindElementByClassName(“android.widget.Button”).
Unlucky, most of the days, it find nothing.
Does anybody know why I’m unable to find the element in the WebView?
DesiredCapabilities cap = new DesiredCapabilities();
cap.SetCapability(CapabilityType.BrowserName, "");
cap.SetCapability("appium-version", "1.2");
cap.SetCapability("platformName", "Android");
cap.SetCapability("platformVersion", "4.4");
cap.SetCapability("appPackage", "XXX");
cap.SetCapability("appActivity", "XXX");
cap.SetCapability("deviceName", "Lenovo S930");
info: [debug] Pushing command to appium work queue: [“find”,{“strategy”:“class n
ame”,“selector”:“android.widget.Button”,“context”:"",“multiple”:false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {“cmd”:“action”,“action”
:“find”,“params”:{“strategy”:“class name”,“selector”:“android.widget.Button”,“co
ntext”:"",“multiple”:false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding android.widget.Button using CLASS_NAME
with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.Button,
INSTANCE=0]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“value”:“No element found”,
“status”:7}
Best Regards,
Lucas Luo