標(biāo)簽: qtp小結(jié)it | 分類: QTP測(cè)試工具 |
a="100"
print a
circuit = "399937"
Function trimString(circuit)
Dim holdArray(5)
holdArray(0) = Left(circuit, 2)
holdArray(1) = Right(circuit, 2)
msgbox holdArray(0) 'showed 39
trimString = holdArray' I get an out of range error here
End Function
dim myArray
'here I want to assign the return array to another array
myArray = trimString(circuit)
' and then call one element from it
msgbox myArray(1)
Browser("Browser").Page("Page").Image("getRates").Click
var_StartTime = Timer
Browser("Browser").Page("Page").Sync
Browser("Browser").Page("Page").Check CheckPoint("Check1")
var_EndTime = Timer
intRespTime = round ((var_EndTime - var_StartTime), 2 )
msgbox (intRespTime)
paramcount = DataTable.GetSheet("Action1").GetParameterCount
msgbox "There are " ¶mcount&"columns in the data sheet."
rowcount = DataTable.GetSheet("Action1").GetRowCount
msgbox "There are " &rowcount&"rows in the data sheet."
Dim WshShell
Set WshShell =CreateObject("Wscrīpt.Shell")
WshShell.RegWrite "HKCU\Software\Mercury Interactive\QuickTest Professional\MicTest\ReservedObjects\GlobalDictionary\ProgID", "scrīpting.Dictionary","REG_SZ"
Set WshShell = Nothing
GlobalDictionary.Add "ParamName", "ParamValue"
Msgbox GlobalDictionary.Item("ParamName")
GlobalDictionary.Item("ParamName")="***********"
Msgbox GlobalDictionary.Item("ParamName")
Msgbox GlobalDictionary.Exists("ParamName")
GlobalDictionary.Remove("ParamName")
Msgbox GlobalDictionary.Exists("ParamName")
SystemUtil.CloseProcessByWndTitle "51testing", True
x="4"
Execute "Dim A_" & x
Execute "A_" & x &"=99"
Msgbox eval_r("A_" & x)
~~~~~~~~~~~~~~~~~~~
x = GetLastError
msgbox(DescribeResult(x))
Setting.WebPackage("ReplayType") = 2 'Default is 1
Browser(".").Page(".").WebList(".").Click
Desktop.CaptureBitmap "C:\Test.bmp",True
Setting.WebPackage("ReplayType") = 1
Reporter.ReportEvent micPass, "TransactionNumber", "<DIV style='font-size: 7pt; color: white'>&</DIV>"&"<B> <FONT COLOR=#000000>"&transNumber&"</FONT></B>"
Reporter.ReportEvent micPass, "TransactionNumber", "<DIV style='font-size: 7pt; color: white'>&</DIV>"&"<B> <FONT COLOR=red>"&transNumber&"</FONT></B>"
For K = 1 To 10 step 2
msgbox k
Next
Option Explicit ' Force explicit variable declaration.
Dim MyVar ' Declare variable.
MyInt = 10 ' Undeclared variable generates error.
MyVar = 10 ' Declared variable does not generate error.
Dim fso, myfile,msg
Set fso=CreateObject("scrīpting.FileSystemObject")
Set myfile = fso.openTextFile("C:\login.txt",1,false)
'這里設(shè)置一個(gè)循環(huán)看需要讀取第幾行
for i=1 to 10
myfile.SkipLine
next
msg=myfile.ReadLine
myfile.close
聯(lián)系客服