appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
18.7k stars 6.06k forks source link

Not able to identify UI objects on appium desktop #12402

Closed pankajpat2014 closed 5 years ago

pankajpat2014 commented 5 years ago

The problem

I am not able to get UI object hierarchy on the appium desktop. I am using browserstack. Please find below screenshot for more understanding appium Desktop screenshot

Environment

I am using below capabilities . { "app": "bs://abcdefg", "platformVersion": "7.1", "deviceName": "Samsung Galaxy Note 8", "platformName": "Android", } appium version 1.6.5

Link to Appium logs

Could not obtain source: {"cause":{"sessionId":"abcdefgh","status":13,"value":{"message":"Appium error: An unknown server-side error occurred while processing the command. Original error: org.w3c.dom.DOMException: \n\tat org.apache.harmony.xml.dom.NodeImpl.setNameNS(NodeImpl.java:241)\n\tat org.apache.harmony.xml.dom.DocumentImpl.renameNode(DocumentImpl.java:318)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.visitNode(XMLHierarchy.java:131)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:96)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.formatXMLInput(XMLHierarchy.java:86)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.getFormattedXMLDoc(XMLHierarchy.java:68)\n\tat io.appium.uiautomator2.handler.Source.safeHandle(Source.java:37)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:56)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:202)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:193)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)\n\tat io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)\n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)\n\tat io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)\n\tat java.lang.Thread.run(Thread.java:761)\n"}},"jsonwire-error":{"detail":"An unknown server-side error occurred while processing the command.","status":13,"summary":"UnknownError"},"message":"[source()] Error response status: 13, , UnknownError - An unknown server-side error occurred while processing the command. Selenium error: Appium error: An unknown server-side error occurred while processing the command. Original error: org.w3c.dom.DOMException: \n\tat org.apache.harmony.xml.dom.NodeImpl.setNameNS(NodeImpl.java:241)\n\tat org.apache.harmony.xml.dom.DocumentImpl.renameNode(DocumentImpl.java:318)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.visitNode(XMLHierarchy.java:131)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:96)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.annotateNodes(XMLHierarchy.java:97)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.formatXMLInput(XMLHierarchy.java:86)\n\tat io.appium.uiautomator2.utils.XMLHierarchy.getFormattedXMLDoc(XMLHierarchy.java:68)\n\tat io.appium.uiautomator2.handler.Source.safeHandle(Source.java:37)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:56)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:202)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:193)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)\n\tat io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)\n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)\n\tat io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)\n\tat java.lang.Thread.run(Thread.java:761)\n","status":13}

mykola-mokhnach commented 5 years ago

There is no way to make this working with UIAutomator1. If you switch to UiAutomator2 and upgrade Appium to the most recent version then there is a special Appium setting, which can make the screen source working. See https://github.com/appium/appium/issues/12265 for more details

pankajpat2014 commented 5 years ago

There is no way to make this working with UIAutomator1. If you switch to UiAutomator2 and upgrade Appium to the most recent version then there is a special Appium setting, which can make the screen source working. See #12265 for more details

I am trying with UiAutomator2 only (in capability I have mentioned "automationName": "UiAutomator2"). I have also seen #12265 , but not getting what are the exact settings which I need to mention in capability. It would be great if you can help me out.

mykola-mokhnach commented 5 years ago

The setting name is normalizeTagNames

mykola-mokhnach commented 5 years ago

Closed as not an issue

pankajpat2014 commented 5 years ago

is there any way where I can set the setting 'normalizeTagNames' on Appium Desktop?

mykola-mokhnach commented 5 years ago

@dpgraham ^ Do you think such feature is possible or would be needed (if not possible)?

dpgraham commented 5 years ago

Yeah, with the latest Appium Desktop you can run the Update Settings command from the Actions tab...

If this was a capability or a server flag then it could easily be set.

pankajpat2014 commented 5 years ago

I have tried to update the setting "normalizeTagNames:true" in appium desktop, but getting below error : I hope I have mentioned correct syntax.

[updateSettings("normalizeTagNames:true")] Error response status: 13, UnknownError - An unknown server-side error occurred while processing the command. Selenium error: An unknown server-side error occurred while processing the command. Original error: Settings update should be called with valid JSON

pankajpat2014 commented 5 years ago

I have tried to update the setting "normalizeTagNames:true" in appium desktop, but getting below error : I hope I have mentioned correct syntax.

[updateSettings("normalizeTagNames:true")] Error response status: 13, UnknownError - An unknown server-side error occurred while processing the command. Selenium error: An unknown server-side error occurred while processing the command. Original error: Settings update should be called with valid JSON

@mykola-mokhnach , @dpgraham I have tried to update the setting "normalizeTagNames:true" in appium desktop, but getting error as mentioned in the above comment. Please provide your help to resolve this issue.

dpgraham commented 5 years ago

@pankajpat2014 can you try running the latest Appium beta: npm install -g appium@beta and then running from the command line.

Then you can add a capability called "settings[normalizeTagNames]"=true to your capabilities.

dpgraham commented 5 years ago

You can run sessions from a terminal instance of Appium using the Custom Server tab.

pankajpat2014 commented 5 years ago

@dpgraham sorry for the late reply, I only have liberty to use appium version 1.9.1 or lower, since I am working on Browserstack cloud which they don't support latest version of appium yet.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.