Error obtaining Ul hierarchy Reason: Error while obtaining Ul hierarchy XML file

一、前置说明

在运行完Appium测试脚本之后,再次使用uiautomatorviewer定位页面元素时,经常会报错:

Error  obtaining  Ul  hierarchy
Reason:
Error  while  obtaining  Ul  hierarchy  XML  file:
com.android.ddmlib.SyncException:  Remote  object  doesn't  exist!

二、解决办法

出现该问题的原因是: Appium Session未结束,当前APP仍处于测试脚本控制之中,所以使用uiautomatorviewer定位页面时,会报"设备不存在"的错误。

方案一:使用quit()方法关闭Appium会话

driver.quit()

方案二:等待一段时间,让Android设备自动断开会话
等待设备自动断开当前会话,断开的标志是:自动退出测试脚本操作的页面,回到首页

三、其他说明

出现该问题,可能还有其他未知的原因,如果上面两种方法仍不能解决问题,那就重启设备、重启uiautomatorviewer。

请相信:有时候,重启可以解决大部分问题,哈哈

请参考 一键重启appium环境,一键启动过程如下:

  1. 启动模拟器
  2. 开启Android设备远程调试,并连接设备
  3. 启动uiautomatorviewer,用于定位元素
  4. 启动Appium Server,用于自动化移动应用程序的测试

欢迎技术交流:

  • 23
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
中文名: Joomla! 宝典 原名: Joomla! Bible 别名: Joomla!,PHP,CMS,宝典,Bible 作者: Ric Shreves资源格式: PDF 出版社: Wiley书号: 978-0-470-50957-9发行时间: 2010年 地区: 美国 语言: 英文 简介:   Joomla!是一套在国外相当知名的内容管理系统   (Content Management System, CMS),它属于Portal(企业入口网站)类型,顾名思义,就是比较适合作为商业类型的网站程序。一般人对这类型的内容管理系统可能会有以下的别名来称呼:   ■ 架站程序(或软件)   ■ 快速架站程序(或软件)   ■ 整站程序   Joomla!是使用PHP语言加上MySQL数据库所开发的软件系统,可以在Linux、 Windows、MacOSX等各种不同的平台上执行。目前是由Open Source Matters (www.opensourcematters.org)这个开放源码组织进行开发与支持,这个组织的成员来自全世界各地,小组成员约有150人,包含了开发者、设计者、系统管理者、文件撰写者,以及超过2万名的参与会员。目前,Joomla!最新的版本是1.5.15 。 Comprehensive guide to creating Web sites with the open-source Joomla!1.5 Joomla! is an open-source content management system (CMS) for Web sites. While it is free and relatively easy to use, there are lots of tricks and functionality that may not be intuitive to new users or those switching from other systems. And the previous version is quite different from the new Joomla 1.5, for which documentation is sparse. Joomla! Bible is the complete, step-by-step guide you need to build and manage Web sites using the very newest version of this powerful and popular CMS. Walks you through obtaining the Joomla! 1.5 code and how to deploy it to a server, configure the site, create content, and manage content and user hierarchies Helps you get the most out of core modules that provide advanced functionality, including the Polls Module, the Banner Manager, the Media Manager, Galleries, Weblinks, Content Syndication, and Newsfeed Aggregation Vaults you into the world of Web 2.0 with extensive coverage of JomSocial, and shows you how to set up for e-commmerce with VirtueMart Get the most out of Joomla! 1.5 with this complete guide guide. 目录: Acknowledgments Contents at a Glance Contents Introduction Part I: Getting Started with Joomla! Chapter 1: Introducing the Joomla! Content Management System Discovering Open Source Content Management Discovering Joomla! The Joomla! architecture Summary Chapter 2: Obtaining and Installing Joomla! Getting the Installation Files Technical Requirements Installing Joomla! Summary Chapter 3: Taking a Look at Joomla! Introducing the Front End (The Public Interface) Introducing the Back End (The Admin Interface) Summary Chapter 4: Getting the Most from Site Configuration Exploring the Global Configuration Manager Working with the Site Tab Using the System Tab Managing Server Tab Options Summary Part II: Working with Content and Users Chapter 5: Managing Content Understanding the Joomla! Content Hierarchy Creating Content Hierarchies Working with Articles Managing Existing Articles Summary Chapter 6: Working with Editors and Media Using WYSIWYG Editors Overview of the Media Manager Working With Media Files Summary Chapter 7: Employing Advanced Content Management Techniques Using Content Display Modules Bringing External Content into Your Site Managing Content from the Front End Syndicating Your Articles Summary Chapter 8: Working with the Menu System Introducing the Menu Manager Creating and Managing Menus Introducing the Menu Item Manager Creating and Managing Menu Items Controlling Access to Menus and Menu Items Summary Chapter 9: Managing the Front Page of Your Site Controlling Front Page Layout Publishing Articles on the Front Page Publishing Component Output on the Front Page Publishing Modules on the Front Page Summary Chapter 10: Working with the User Manager Introducing the User Manager Understanding the Joomla! User Hierarchy Adding Users to the System Managing Users Creating User Registration Controlling Access to Content and Functionalities Summary Chapter 11: Working with the Language Manager The Function of the Language Manager Installing New Language Packs Modifying a Language Pack Specifying the Language Used Summary Part III: Working with Components, Modules, and Plugins Chapter 12: Using the Banner Manager Introducing the Banner Manager Understanding Banner Parameters Managing Clients Managing Categories Managing Banners Using the Banners Module Summary Chapter 13: Working with the Contact Manager Introducing the Contact Manager Setting Contact Parameters Managing Contacts and Categories Creating Contact Forms Summary Chapter 14: Using the News Feeds Component Introducing the News Feeds Manager Understanding News Feed Parameters Managing Feeds and Categories Summary Chapter 15: Using the Polls Component Introducing the Poll Manager Creating and Managing Polls Displaying Polls Summary Chapter 16: Using the Web Links Component Introducing the Web Link Manager Setting Web Links Parameters Managing Links and Categories Summary Chapter 17: Working with the Site Modules Reviewing the Module Manager Introducing the Site Modules Summary Chapter 18: Working With the Administrator Modules Reviewing the Module Manager Reviewing the Administrator Modules Summary Chapter 19: Working with Plugins Introducing the Plugin Manager Reviewing the Default Plugins Summary Part IV: Customizing and Extending the System Chapter 20: Customizing Joomla! Templates Discovering How the Templates Work Exploring the Default Templates Knowing the Parts of a Template Introducing the Template Manager Customizing Templates Controlling the Appearance of Menus Working with Module Chrome Overriding Pagination Formatting Creating a New Template Working With the Admin Template Summary Chapter 21: Customizing Joomla! Functionality Understanding Basic Principles Using the Right Tools Discovering the Joomla! API Working with Components Working with Modules Working with Plugins Summary Chapter 22: Extending Your Site Finding Extensions Working with the Extension Manager Finding the Right Extension for the Job Summary Chapter 23: Implementing e-Commerce with VirtueMart Introducing VirtueMart Obtaining and Installing VirtueMart Reviewing the VirtueMart Control Panel Configuring VirtueMart Administering the Store Summary Chapter 24: Creating a Community Site with JomSocial Introducing JomSocial Obtaining and Installing JomSocial Overview of the JomSocial Control Panel Configuring JomSocial Administering the Community Summary Part V: Site Maintenance and Management Chapter 25: Keeping Your Site Secure and Up to Date Security Best Practices Keeping Up With Security Notices Managing Site Maintenance Upgrading a Joomla! Installation Summary Chapter 26: Managing Performance and Accessibility Understanding Cache Management Improving Content Performance Tuning Joomla! Performance Enhancing Accessibility Summary Chapter 27: Making a Site Search Engine Friendly Creating Search Engine Friendly URLs Creating Custom Error Pages Working with Metadata and Page Titles Summary Part VI: Appendixes Appendix A: The Directory Structure of a Joomla! Installation Appendix B: A Guide to the Location of Key Files Appendix C: Installing XAMPP Appendix D: Installing MAMP Appendix E: Additional Online Help Resources The Help Files inside Joomla! Online Help and Support Resources Using Community Support Options Finding Commercial Support Index
"Unexpected error while obtaining UI hierarchy java.lang.reflect.InvocationTargetException" 是一个错误信息,通常出现在使用UI自动化测试工具时。这个错误表示在获取UI层次结构时发生了意外的错误,并且由于反射调用的异常导致了错误。 这个错误可能有多种原因,包括但不限于以下几点: 1. 应用程序或设备的状态异常:可能是应用程序或设备处于不正常的状态,导致无法正确获取UI层次结构。 2. 权限问题:可能是测试工具没有足够的权限来获取UI层次结构。 3. 兼容性问题:可能是测试工具与应用程序或设备的版本不兼容,导致无法正确获取UI层次结构。 4. 其他异常情况:还有其他一些可能的异常情况,例如网络连接问题、设备连接问题等。 为了解决这个问题,你可以尝试以下几个步骤: 1. 重新启动应用程序和设备:尝试重新启动应用程序和设备,以确保它们处于正常的状态。 2. 检查权限:确保测试工具具有足够的权限来获取UI层次结构。可以尝试使用管理员权限或者检查测试工具的权限设置。 3. 更新测试工具和应用程序:如果可能的话,尝试更新测试工具和应用程序到最新版本,以确保它们兼容。 4. 检查其他异常情况:检查其他可能的异常情况,例如网络连接问题、设备连接问题等。 如果以上步骤都没有解决问题,建议查看具体的错误日志或者咨询相关的技术支持人员,以获取更详细的帮助和解决方案。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kinder-balabala

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值