Inspector not showing name/xpath/tagname

Hi,

My sample app do not have any name/id/tagname/xpath when i do inspect. Could you please explain me how to code click for this ? In the inspector, when i click on a button it shows below details.

index:1
text:
class:android.widget.ImageView
package:org.qtproject.example.MyApp
enabled:true
focused:false
selected:false
location:[268,0]
size:266X266

Hi Rohansurya,

Inspector is accessing element using “class name”, and based of index it perform action.
if you want to perform any action like click and etc.

Get list of element using class name and then perform action based on index.

I hope it will helpful.

Hi dharam,

I tried accessing the element using the class name but got the below error.

info: [debug] Responding to client with error: {“status”:32,“value”:{“message”:“Argument was an invalid selector (e.g.XPath/CSS).”,“origValue”:“javax.xml.transform.TransformerException: Extra illegal tokens: ‘$’, ‘VirtualChild’, ‘[’, ‘@’, ‘index’, ‘=’, ‘0’,’]’”},“sessionId”:“e60ed97b-255d-4336-ac0e-5fd701fe95ff”}

class name: org.qtproject.qt5.android.QTSurface$VirtualChild
package name: com.wearyinside.MyApp

Are you trying to access a non native UI Element?

No, I am trying to access native UI elements.

org.qtproject.qt5.android.QTSurface$VirtualChild doesn’t sound right, try to print the page source before you do the find.

Hi Sebv,

Ours is a native android application. Can we get the page source for native apps? If yes, please help me with the steps to find the same.

Yes just check your driver doc.

Another way to get element properties …
Load the page in Device/Emulator and then use uiautomatorviewer command in Android sdk tools directory.