This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 18
Sep 2018

I tried clicking Solve button with XPath, resource id and all other ways but couldn’t click it just because it is part of recycler view

Do you get an error? (If so, please post it here)

Also, why is there a recycler view? Is that needed?

No, I don’t get any error.Appium stops for few seconds and then at the end it displays “No such element exception” in eclipse. And yes recycler view is needed. Please guide me I am stuck in due to this since five days

I have tried that also but it is not working. First I tried with resource id only.

did you try to click that button using Appium Desktop? Maybe that helps to drill down the root.

My app is android and not IOS. How can I use appium desktop for android?I mean to say can I use appium desktop for android???

yes, you can use appium desktop for Android if your running in mac machine. Are you running in Windows machine? have you checked whether the option is available?

Yes I am using MAC machine.Let me check and then I will come back.Thank you for helping me uptill now, let me try this solution

driver.findElementByXPath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.support.v4.widget.DrawerLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.support.v4.view.ViewPager/android.view.ViewGroup/android.widget.ScrollView/android.widget.LinearLayout/android.support.v7.widget.RecyclerView[1]/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.TextView[3]").click();

I simply copy pasted from Appium desktop. But the issue is still there. It is unable to click.

This is the error I am getting:
[HTTP] --> POST /wd/hub/session/7f970102-3ae8-473c-8ca8-791f4f59abe4/element
[HTTP] {“using”:“xpath”,“value”:"//android.widget.TextView[@text=‘SOLVE’]"}
[W3C] Calling AppiumDriver.findElement() with args: [“xpath”,"//android.widget.TextView[@text=‘SOLVE’]",“7f970102-3ae8-473c-8ca8-791f4f59abe4”]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 10000 ms for condition
[AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//android.widget.TextView[@text=‘SOLVE’]",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:“xpath”,“selector”:"//android.widget.TextView[@text=‘SOLVE’]",“context”:"",“multiple”:false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘//android.widget.TextView[@text=‘SOLVE’]’ using ‘XPATH’ with the contextId: ‘’ multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:32,“value”:“javax.xml.transform.TransformerException: A location path was expected, but the following token was encountered: ‘SOLVE’”}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Matched JSONWP error code 32 to InvalidSelectorError
[W3C] Encountered internal error running command: InvalidSelectorError: javax.xml.transform.TransformerException: A location path was expected, but the following token was encountered: ‘SOLVE’
[W3C] at errorFromMJSONWPStatusCode (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-base-driver/lib/protocol/errors.js:784:12)
[W3C] at Socket. (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-android-bootstrap/lib/bootstrap.js:139:18)
[W3C] at emitOne (events.js:116:13)
[W3C] at Socket.emit (events.js:211:7)
[W3C] at addChunk (_stream_readable.js:263:12)
[W3C] at readableAddChunk (_stream_readable.js:246:13)
[W3C] at Socket.Readable.push (_stream_readable.js:208:10)
[W3C] at TCP.onread (net.js:594:20)
[HTTP] <-- POST /wd/hub/session/7f970102-3ae8-473c-8ca8-791f4f59abe4/element 400 195 ms - 931
[HTTP]

ask your dev to add a unique value in the content-desc and try to locate that element. Hope that works

22 days later