QTP的3类顺序标识(Ordinal Identifiers)

本文介绍了QTP中三种顺序标识(Location, Index 和 CreationTime)的概念及应用实例,重点讲解了如何利用这些标识来增强对象识别的独特性,尤其是在描述性编程场景中。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

对于顺序标识(Ordinal Identifiers),QTP的帮助文档是这样说的:

An ordinal identifier assigns a numerical value to a test object that indicates its order or location relative to other objects with an otherwise identical description (objects that have the same values for all properties). This ordered value provides a backup mechanism that enables QuickTest to create a unique description to recognize an object when the defined properties are not sufficient to do so.

 

总共有3类这样的顺序标识(Ordinal Identifiers):Location, Index CreationTime

 

其中CreationTime仅适用于Browser对象。

 

顺序标识(Ordinal Identifiers)通常在描述性编程时使用。

1locationlocation顺序标识是用上到下进行的)

'Text Box 1

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest","location:=0").Set "1"

 

'Text Box 3

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest","location:=1").Set "2"

 

'Text Box 2

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest","location:=2").Set "3"

 

'Text Box 4

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest","location:=3").Set "4"

 

 

2indexindex顺序标识是从左到右进行的)

'Text Box 1

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest", "index:=0").Set "1"

 

'Text Box 2

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest", "index:=1").Set "2"

 

'Text Box 3

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest", "index:=2").Set "3"

 

'Text Box 4

Browser("title:=.*Descriptive.*").Page("micclass:=Page").WebEdit("name:=dpTest", "index:=3").Set "4"

 

 

3CreationTime(仅对浏览器对象生效,按对象产生时间先后顺序排列)

SystemUtil.Run "iexplore.exe", "http://www.HP.com"               'CreationTime 0

SystemUtil.Run "iexplore.exe", "http://www.AdvancedQTP.com"      'CreationTime 1

SystemUtil.Run "iexplore.exe", "http://www.LinkedIn.com"         'CreationTime 2

 

Browser( "creationtime:=" ).Highlight     'Highlight HP.com

Browser( "creationtime:=1" ).Highlight    'Highlight AdvancedQTP.com

Browser( "creationtime:=2" ).Highlight    'Highlight LinkedIn.com

 

 

 

参考:

http://relevantcodes.com/descriptive-programming-dp-concepts-3-ordinal-identifiers-demo/

 

资源下载链接为: https://pan.quark.cn/s/67c535f75d4c 《一芯量产工具 FirstChip MpTools 20211024 详解及应用》 在数字存储领域,U 盘作为便携式存储设备的典型代表,其稳定性和可靠性极为关键。而 “FirstChip_MpTools_20211024” 正是专为一芯(FirstChip)芯片打造的 U 盘量产工具,主要用于 FC1178 和 FC1179 系列芯片的 U 盘生产、测试与修复工作。本文将深入剖析该工具的功能、使用方法以及其在 U 盘量产过程中的重要作用。 一芯(FirstChip)是一家专注于存储控制器研发的企业,其 FC1178 和 FC1179 芯片被广泛应用于众多 U 盘产品中。这些芯片具备高性能、低功耗以及高兼容性等诸多优点,但在少数情况下,也可能会出现诸如数据丢失、无法识别等故障,此时就需要借助专业的量产工具来进行修复。 “FirstChip MpTools” 是一款功能强大的一芯 U 盘量产管理软件,具备以下功能:一是进行初始化与格式化操作,能够清除 U 盘中的所有数据,并且可以设置不同的文件系统格式,比如 FAT32、NTFS 或 exFAT,以满足不同用户的多样化需求;二是开展性能测试,通过读写速度测试来评估 U 盘的实际性能,帮助用户判断 U 盘的读写速度是否达到了预期的标准;三是进行坏块检测与修复,扫描 U 盘中可能存在的坏块,并尝试对其进行修复,从而确保 U 盘能够稳定运行;四是实现容量调整,允许用户根据实际需求对 U 盘的可用容量进行调整,在处理扩容盘或者修复容量异常的 U 盘时极为实用;五是进行安全擦除,能够彻底删除 U 盘上的所有数据,确保信息安全无虞;六是开展固件升级,对 U 盘的固件进行更新,以此提高兼容性、修复已知问题或者解锁新的功能。 使用 “FirstChip M
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值