'utility.chm练习
'systemutil.run "http://www.baidu.com"
'Browser("micClass:=Browser").Page("micClass:=Page").WebEdit("name:=wd").Set "51testing"
'Browser("micClass:=Browser").Page("micClass:=Page").Link("name:=知 道").click
'
'
'Dim a,m
'a=DataTable.GetSheet("Action1").SetCurrentRow 2
'm=typename(a)
'print m
'
'DotNetFactory组件的应用。
'Set var_CreateInstance=DotNetFactory.CreateInstance("System.Environment")
'msgbox var_CreateInstance.CurrentDirectoryli
'Crypt Object的利用
'Dim pwd
'pwd="125_125"
'e_pwd=crypt.Encrypt(pwd)
''print e_pwd
''经检验,Encrypt方法的加密情况与QTP自带的字段加密工具 可能不是很一样。
'systemutil.Run "http://www.baidu.com"
'
'Browser("micClass:=Browser").Page("micClass:=Page").Link("name:=登录").Click
'Browser("micClass:=Browser").Page("micClass:=Page").Frame("title:=登录").WebEdit("name:=username","html id:=pass_login_username_0").Set "lijingprince"
'
'Browser("micClass:=Browser").Page("micClass:=Page").Frame("title:=登录").WebEdit("name:=password","html id:=pass_login_password_0").SetSecure "51354e7676cd070d4000c452bd17c965ce6d633d"
'
'Browser("micClass:=Browser").Page("micClass:=Page").Frame("title:=登录").WebButton("micClass:=WebButton","html id:=pass_login_input_submit_0").Click
'
'If Browser("micClass:=Browser").Page("micClass:=Page").Frame("title:=登录").WebEdit("name:=username","html id:=pass_login_username_0").Exist Then
' msgbox "框架存在!"
'End If
'
'Dim sStr
'sStr=datatable.AddSheet("MySheet").AddParameter("Time","8:00")
'print sStr
'datatable.Export("c:\1234.xls")
'datatable.DeleteSheet("MySheet")
'
'
'row=Datatable.GetCurrentRow
'reporter.ReportEvent 1,"Row Number",row
'
'Check if an External Environment file is loaded and if nt
',load it
' timer user(mercuryTimers.Timer)
'计时器的使用
'Dim time1
'Set MyTimer=MercuryTimers.Timer("lijing1")
'MyTimer.Start
'wait 2
'systemutil.Run "notepad.exe"
'MyTimer.Stop
''调用elapsedTime属性
'time1=MyTimer.ElapsedTime
'print time1
'
'首先要确定在以下位置有否设置文件路径
'Tools > Options > GUI Testing tab > Folders pane
'PathFinder Object
'Dim y
'y=PathFinder.Locate("123.xls")
'print y
'Randomize
'Dim x
'x= int(rnd * 100 +1)
'print x
'以下是reporter object的应用
'systemutil.Run "http://www.baidu.com"
'Browser("micClass:=Browser").Page("micClass:=Page").Image("micClass:=Image","src:=http://www\.baidu\.com/img/shouye_b5486898c692066bd2cbaeda86d74448\.gif").CaptureBitmap("mylogo.bmp")
'Reporter.ReportEvent micDone,"Display Logo","This is myLogo","mylogo.bmp"
'
'Reporter.ReportNote "This test was run from IP 12.34.56.89 using a wireless connection."
'Reporter.ReportNote "This test was run on version "& Datatable.GlobalSheet.GetParameter("App_Version_Value")
'Reporter.ReportNote "This current test configuration is " & Environment("OS")
'
'Reporter.ReportEvent micDone,"1","123"
'Reporter.ReportEvent micDone,"2","123"
'Reporter.Filter = rfDisableAll
'Reporter.ReportEvent micDone,"3",""
'Reporter.ReportEvent micDone,"4",""
'Reporter.Filter = rfEnableAll
'Reporter.ReportEvent micDone, "5",""
'Reporter.ReportEvent micDone, "6",""