Cannot locate elements using content-desc

Dear guys,

Now i am testing an App on Android. However when i use uiautomator to check the available elements, there’re only context-desc available. No resource-id, no Index and also no some other identifier.

Then i try to use findElementByAccessibilityId to identify the element i want to click. But i doesn’t work.

I was wondering if anyone met this before ? Please help

Below are the screenshot when i use uiautomator .

Thanks in advance

Some uiautomator feature such as resource id (API 18+) depend on the API level of Android.


I’m using API 19 and the OS is Android 4.4.2

From the uiautomatorviewer screenshot it looks like you’re inspecting a WebView. Elements contained within a webview wouldn’t normally contain native element specific identifiers such as a resource id.

So according to this, do we have any solutions that i can identify the button ‘CONTINUE’?

Try switching to the webview context.

Many thanks. i will try to switch Webview. Once i got a solution, i will post on

Hello, i have tried to switch to WEBVIEW(pls refer below screenshot), however i still got some errors.

For the error message, please refer below.
Now i am totally have no idea…

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.92 seconds
Build info: version: ‘2.43.1’, revision: ‘5163bceef1bc36d43f3dc0b83c88998168a363a0’, time: ‘2014-09-10 09:43:55’
System info: host: ‘ADMINIB-757P3E7’, ip: ‘’, ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.7.0_67’
Session ID: 966a6866-2252-424c-a950-34b4e0d36a8d
Driver info:
Capabilities [{platform=WINDOWS, app=C:\Users\IBM_ADMIN\EclipseLuna\bankingapptest\apps\StarterAppsStarterAppBankAndroid.apk, javascriptEnabled=true, appActivity=.StarterAppBank, browserName=Android, networkConnectionEnabled=true, desired={platformVersion=4.4, app=C:\Users\IBM_ADMIN\EclipseLuna\bankingapptest\apps\StarterAppsStarterAppBankAndroid.apk, platform=WINDOWS, deviceName=Android Emulator, platformName=Android, appActivity=.StarterAppBank, appPackage=com.StarterAppBank}, locationContextEnabled=false, appPackage=com.StarterAppBank, platformVersion=4.4, databaseEnabled=false, platformName=Android, deviceName=Android Emulator, webStorageEnabled=false, warnings={}, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
at java.lang.reflect.Constructor.newInstance(
at org.openqa.selenium.remote.ErrorHandler.createThrowable(
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(
at org.openqa.selenium.remote.RemoteWebDriver.execute(
at io.appium.java_client.AppiumDriver.execute(
at org.openqa.selenium.remote.RemoteWebDriver.findElement(
at bankingapp.bankingapptest.BankingAppTest.AppTest(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
at org.junit.runners.model.FrameworkMethod.invokeExplosively(
at org.junit.internal.runners.statements.InvokeMethod.evaluate(
at org.junit.internal.runners.statements.RunBefores.evaluate(
at org.junit.internal.runners.statements.RunAfters.evaluate(
at org.junit.runners.ParentRunner.runLeaf(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.BlockJUnit4ClassRunner.runChild(
at org.junit.runners.ParentRunner$
at org.junit.runners.ParentRunner$1.schedule(
at org.junit.runners.ParentRunner.runChildren(
at org.junit.runners.ParentRunner.access$000(
at org.junit.runners.ParentRunner$2.evaluate(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

I’m not sure. That error message isn’t too informative.

Hey suroit,
Probably You can use xpaths.
The Appium Inspector for iOS version gives the xpaths.(Appium v1.2.2) dmg
It works in my case.

Thanks, Shirodkar. I will try to use XPATH.

Hi Suroit,

Were you able to locate elements using xpath on WEBVIEW? I keep getting the error message:

derived selector: (:by => xpath) //android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.widget.ImageView[1]
info: --> POST /wd/hub/session/7012df53-fe0c-4670-966e-1fe6a804c470/element {“using”:“xpath”,“value”:"//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.widget.ImageView[1]"}
info: [debug] Proxying command to
info: [debug] Making http request with opts: {“url”:“",“method”:“POST”,“json”:{“using”:“xpath”,“value”:"//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.widget.ImageView[1]”}}
info: [debug] Responding to client with error: {“status”:7,“value”:{“message”:“An element could not be located on the page using the given search parameters.”,“origValue”:“no such element\n (Session info: webview=)\n (Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64)”},“sessionId”:“7012df53-fe0c-4670-966e-1fe6a804c470”}
info: <-- POST /wd/hub/session/7012df53-fe0c-4670-966e-1fe6a804c470/element 500 2370.214 ms - 297
info: --> GET /wd/hub/session/7012df53-fe0c-4670-966e-1fe6a804c470/screenshot {}
info: [debug] Proxying command to
info: [debug] Making http request with opts: {“url”:“",“method”:"GET”}
info: [debug] Proxied response received with status 200: “{“sessionId”:“d806f724c5e912760b6f6f6362a8df94”,“status”:13,“value”:{“message”:“unknown error: unhandled inspector error: {\“code\”:-32603,\“message\”:\“Unable to capture screenshot\”}\n (Session info: webview=)\n (Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64)”}}”
info: <-- GET /wd/hub/session/7012df53-fe0c-4670-966e-1fe6a804c470/screenshot 200 148.491 ms - 290
Can’t take screen shot so skiping it
unknown error: unhandled inspector error: {“code”:-32603,“message”:“Unable to capture screenshot”}
(Session info: webview=)
(Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64)

Hi Shankybnl,

Before you locate elements on WEBVIEW, you need to switch to WEBVIEW in the code.

Set contextNames = driver.getContextHandles();

    for (String contextName : contextNames) {


      if (contextName.contains("WEBVIEW")){




          System.out.println("no WEBVIEW"); 


1 Like

Thank you Suroit.

I was able to switch to WEBVIEW context but unable to locate elements in the WEBVIEW. Actually i was using xpath (//android.widget.TextView…) which works in NATIVE_APP. On using web xpath (//input[@name=‘element’]), issue has been resolved.

That’s weird. Actually i haven’t solve this problem so far. In my App, i not be able switch to WEBVIEW context. In general, when we switch to WEBVIEW, we can locate elements by XPATH or some other methods.
But, yes, like you said, it doesn’t work.

Sorry that i cannot help on this for now. i will keep searching on this case, once i got the solution, i will let you know.

Hi Guys,

I am new to Appium and as per the screenshot I am trying to find resource-id of whatsapp but it is not getting displayed in uiautomatorviewer. I have samsung Duos with Android version 4.4.2. So can you please help to find resource-id using uiautomator viewer