国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書(shū)等14項(xiàng)超值服

開(kāi)通VIP
[轉(zhuǎn)]qtp小結(jié)

[轉(zhuǎn)]qtp小結(jié)

(2008-09-18 20:50:20)
標(biāo)簽:

qtp

小結(jié)

it

分類: QTP測(cè)試工具

1.在測(cè)試中我們使用QTP調(diào)試腳本的時(shí)候一般就是DEBUG或者M(jìn)SGBOX察看一些信息,其實(shí)有時(shí)候也可以使用print來(lái)實(shí)現(xiàn)批量的察看信息但是不影響程序運(yùn)行.
運(yùn)行腳本:

復(fù)制內(nèi)容到剪貼板
代碼:
a="100"
print a
~~~~~~~~~~~~~~~~~~~~~~~~~
2.取datatable特定行的數(shù)據(jù)可以這樣使用
運(yùn)行腳本:
復(fù)制內(nèi)容到剪貼板
代碼:
DataTable.GetSheet("Action1").GetParameter("test\").ValueByRow(4)
~~~~~~~~~~~~~~~~~~
3.Wait Seconds [, Milliseconds]可以精確到毫秒.
~~~~~~~~~~~~~~~~~~
4.在自定義的function里面數(shù)組作為返回值.
運(yùn)行腳本:
復(fù)制內(nèi)容到剪貼板
代碼:
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)
~~~~~~~~~~~~~~~
5.計(jì)算一個(gè)操作的時(shí)間.
運(yùn)行腳本:
復(fù)制內(nèi)容到剪貼板
代碼:
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)
~~~~~~~~~~~~~~~
6.取得指定sheet(datatable)的行數(shù)和列數(shù)(也可以理解為參數(shù)個(gè)數(shù))
復(fù)制內(nèi)容到剪貼板
代碼:
paramcount = DataTable.GetSheet("Action1").GetParameterCount
msgbox "There are " &paramcount&"columns in the data sheet."
rowcount = DataTable.GetSheet("Action1").GetRowCount
msgbox "There are " &rowcount&"rows in the data sheet."
~~~~~~~~~~
7.一種設(shè)置全局變量的方法GlobalDictionary
'Part 1.
'***********************************************************************************************************
復(fù)制內(nèi)容到剪貼板
代碼:
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
'*********************************************************************************************************************
'Part 2.
'*****************************************************************************************
復(fù)制內(nèi)容到剪貼板
代碼:
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")
'*********************************************************************************************
~~~~~~~~~~~
8.關(guān)掉多余的IE窗口
復(fù)制內(nèi)容到剪貼板
代碼:
SystemUtil.CloseProcessByWndTitle "51testing", True
~~~~~~~~~~~~~~~~~~
9.Execute 的用法,這個(gè)用法在一些特殊時(shí)候很有用的.
復(fù)制內(nèi)容到剪貼板
代碼:
x="4"
Execute "Dim A_" & x
Execute "A_" & x &"=99"
Msgbox eval_r("A_" & x)  
~~~~~~~~~~~~~~~~~~~
10.GetLastError的介紹,看字面就是取運(yùn)行最后一個(gè)錯(cuò)誤
復(fù)制內(nèi)容到剪貼板
代碼:
x = GetLastError
msgbox(DescribeResult(x))
這樣可以在程序里面判斷程序運(yùn)行時(shí)候是否出錯(cuò)了.
~~~~~~~~~~~~~~~~~
11.把weblist抓圖下來(lái)
復(fù)制內(nèi)容到剪貼板
代碼:
Setting.WebPackage("ReplayType") = 2 'Default is 1
Browser(".").Page(".").WebList(".").Click
Desktop.CaptureBitmap "C:\Test.bmp",True
Setting.WebPackage("ReplayType") = 1
~~~~~~~~~~~~~~~~~~~~~~~~~~
12.Reporter.ReportEvent的新用法
transNumber = 12345
復(fù)制內(nèi)容到剪貼板
代碼:
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>"
~~~~~~~~~~~~~~~~~~~~~~~~~~
13.For循環(huán)中step的用法
復(fù)制內(nèi)容到剪貼板
代碼:
For K = 1 To 10 step 2
          msgbox k
Next
~~~~~~~~~~~~~~~~~~~~~~~
14.Option Explicit,大家都知道VB scrīpt里面是可以不申明變量直接使用,但是有時(shí)候我們?yōu)榱四_本的規(guī)范,盡量申明使用的變量,這樣你就用一下Option Explicit吧.
復(fù)制內(nèi)容到剪貼板
代碼:
Option Explicit   ' Force explicit variable declaration.
Dim MyVar   ' Declare variable.
MyInt = 10   ' Undeclared variable generates error.
MyVar = 10   ' Declared variable does not generate error.
~~~~~~~~~~~~~~~~~~~~~~~
14.從TXT文件里面讀取特定行的數(shù)據(jù).
復(fù)制內(nèi)容到剪貼板
代碼:
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
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
文件打開(kāi)的幾種方式(c/c++/Windows)
【VBA代碼】
spring mvc3.0.6 +jquery ajaxfileupload 做導(dǎo)入EXCEL到數(shù)據(jù)庫(kù) 無(wú)需刷新 (第四篇)
互助問(wèn)答第16期:outreg2輸出Word、Excel的使用
Ubuntu10.10下的7z文件解壓工具
如何通過(guò)VBA打開(kāi)一個(gè)局域網(wǎng)中指定路徑的文
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服