自动化测试专家,专注于自动化测试领域的框架开发及国外最新自动化技术,担任过银行、电子商务等项目的自动化测试工作,精通自动化测试工具QTP、Watir等.并对QTP有过深入的研究,有过企业内训和工具培训经验,希望能与各位同行一起沟通,交流,探讨。 zzxxbb112@hotmail.com
【QTP系列讲座 28】==正则表达式的应用 ==
上一篇 /
下一篇 2011-10-31 16:59:23
/ 个人分类:QTP系列讲座
Rss订阅IQuickTest(关于如何订阅?)51Testing软件测试网_%v6rdWS0S}
GoogleReader订阅地址: http://feeds.feedburner.com/iquicktest
!\A+q,W.s4D o0作者:zzxxbb112
时间:2010/2/23 版权所有,侵权必究。
F*Hfh0VX0出处:http://blog.csdn.net/zzxxbb112
;c0T;E.fv0
正则表达式相信很多朋友都不陌生,它是一个非常常用的技术,不管是在什么语言中,今天我们就来看一下QTP中正则表达式的应用。
1\]H6L&i
tt051Testing软件测试网2^|r&K;h r
- systemutil.Run "iexplore.exe","www.baidu.com"
- Browser("title:=.*").Page("name:=.*").WebEdit("name:=wd").Set "zzxxbb112"
51Testing软件测试网7i&o5CdJ#r
L.Lvo:F0当我们在使用描述性编程时,我们可以使用正则来代替长标题
3G5]}C6`)v9Xz0在VBS中有一个叫REGEXP的类,它提供了简单的正则支持51Testing软件测试网-}we?1vxi"aq*w
't*t4I8cQ4`0- Function RegExpTest(patrn, strng)
- Dim regEx, Match, Matches
- Set regEx = New RegExp
- regEx.Pattern = patrn
- regEx.IgnoreCase = True
- regEx.Global = True
- Set Matches = regEx.Execute(strng)
- For Each Match in Matches
- RetStr = RetStr & "Match found at position "
- RetStr = RetStr & Match.FirstIndex & ". Match Value is '"
- RetStr = RetStr & Match.Value & "'." & vbCRLF
- Next
- RegExpTest = RetStr
- <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style. initial; border-color: initial; border-top-style. none; border-
收藏
举报
TAG:
iquicktest
QTP
qtp