Unable to inspect elements of screen containing recycler view


#1

Unable to inspect elements of screen containing recycler view


#2

Can you post screenshot of Appium desktop?


#3


#4

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


#5

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

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


#6

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


#7

Just giving the resource id should work


#8

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


#9

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


#10

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???


#11

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?


#12

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


#13

Can you share the xpath which you tried?


#15

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.


#16

("//android.widget.TextView[@text=‘SOLVE’]")

Can you try this xpath? Adjust the single and doubt quotes in your IDE


#17

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]


#18

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


#19

This is also not working, please help me