[英]Android Hybrid App - Chrome inspect Xpath unable to find using Java
I'm very new to Android Application Testing. 我是Android应用程序测试的新手。 I started testing on a Hybrid Apps , After login page I want to capture few xpath and values of some specific elements.
我开始在Hybrid Apps上进行测试,登录页面后,我想捕获一些特定的元素的xpath和值。 I used chrome inspector to find xpath of few elements.
我使用chrome inspector查找了一些元素的xpath。 When I used the same xpath in my java code it's not finding it.
当我在Java代码中使用相同的xpath时,找不到它。 Size of xpath is showing as Zero.
xpath的大小显示为零。
I have already used Thread.sleep , element wait. 我已经使用过Thread.sleep,元素等待。 I'm using the same xpath which I got from chrome inspector - Copyxpath feature.
我正在使用从chrome inspector获得的相同xpath-Copyxpath功能。
Please help me how to verify if any frame or layout present in the application. 请帮助我如何验证应用程序中是否存在任何框架或布局。 I have attached HTML and my code, Added my new screen shot.
我已经附加了HTML和代码,并添加了新的屏幕截图。
[1]: https://i.stack.imgur .com/mvG6s.png [1]:https: //i.stack.imgur.com/mvG6s.png
Based on the screenshot, and the assumption that the arrow points from the line of code that fails to the HTML code it is supposed to match-up with, you have an incorrect XPath. 根据屏幕截图,并假设箭头从失败的代码行指向应该与之匹配的HTML代码,您有一个不正确的XPath。 It goes from ion-side-menu-content to ion-tabs which does not match the highlighted line in the HTML code which instead goes to ion-header-bar .
它从ion-side-menu-content到ion-tabs ,与HTML代码中突出显示的行不匹配,而HTML代码改为ion-header-bar 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.