91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

VB調用QTP

發布時間:2020-07-30 20:59:55 來源:網絡 閱讀:263 作者:lisa2014 欄目:軟件技術

今天幫一個加拿大的朋友解決VB調用QTP的問題,自己寫了一個Demo 。

下邊是源代碼

1.新建工程,引入QuickTest Professional 8.0 object library

2.編寫代碼如下:

Private strScriptName As String
Private strRunScript As String


Private Sub cmdAddScript_Click()
strScriptName = InputBox("請輸入QuickTestPro腳本的路徑以及名字", "Select Script")
lstQtpScript.AddItem strScriptName
strScriptName = ""
End Sub

Private Sub cmdRunScript_Click()

If strRunScript = "" Then
MsgBox "please select you want to a running script in listbox"
Else
Dim qtApp As QuickTest.Application ' Declare the Application object variable
Dim qtTest As QuickTest.Test ' Declare a Test object variable
Dim qtResultsOpt As QuickTest.RunResultsOptions ' Declare a Run Results Options object variable

Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Start QuickTest
qtApp.Visible = True ' Make the QuickTest application visible

' Set QuickTest run options
qtApp.Options.Run.CaptureForTestResults = "OnError"
qtApp.Options.Run.RunMode = "Fast"
qtApp.Options.Run.ViewResults = False

qtApp.Open strRunScript, True ' Open the test in read-only mode

' set run settings for the test
Set qtTest = qtApp.Test
qtTest.Settings.Run.IterationMode = "rngIterations" ' Run only iterations 2 to 4
qtTest.Settings.Run.StartIteration = 2
qtTest.Settings.Run.EndIteration = 4
qtTest.Settings.Run. ' Instruct QuickTest to perform next step when error occurs

Set qtResultsOpt = CreateObject("QuickTest.RunResultsOptions") ' Create the Run Results Options object
qtResultsOpt.ResultsLocation = strRunScript + "\Res1" ' Set the results location

qtTest.Run qtResultsOpt ' Run the test

'MsgBox qtTest.LastRunResults.Status ' Check the results of the test run
qtTest.Close ' Close the test
qtApp.Quit 'Close QuickTestPro

Set qtResultsOpt = Nothing ' Release the Run Results Options object
Set qtTest = Nothing ' Release the Test object
Set qtApp = Nothing ' Release the Application object

strRunScript = ""
End If

End Sub

Private Sub Form_Load()
strScriptName = ""
strRunScript = ""
End Sub

Private Sub lstQtpScript_Click()
strRunScript = lstQtpScript.Text
End Sub


由于不是具體講vb的使用所以里面如何新建工程等都省略掉了,如果大家有興趣可以自己找相關書籍學習。

以上代碼在vb6.0 winxp sp2調試通過。


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

辽中县| 保德县| 石景山区| 乐平市| 甘谷县| 双柏县| 侯马市| 黎平县| 唐河县| 喀喇沁旗| 庆城县| 高要市| 黑河市| 乡城县| 壶关县| 永寿县| 偏关县| 桃源县| 九寨沟县| 滁州市| 民县| 彭州市| 府谷县| 马公市| 晋中市| 娱乐| 湾仔区| 乌兰察布市| 澄江县| 清苑县| 巴楚县| 罗甸县| 鄱阳县| 克什克腾旗| 新乡市| 宿州市| 格尔木市| 汝州市| 保定市| 钟山县| 卓资县|