當前位置:首頁 » 編程軟體 » qtp腳本調用函數

qtp腳本調用函數

發布時間: 2024-08-25 03:26:55

❶ qtp測試腳本語言是什麼

QTP是基於VBS腳本語言的,大部分VBS腳本都能在QTP上運行,只是在一些細節上略有不同,比如說VBS上停止用sleep,QTP上用wait。QTP的強大之處在於對程序窗口的操作,有很多針對窗體的屬性、方法,這個是VBS所沒有的。

❷ QTP軟體如何運行vbs腳本

是想問QTP中如何調用VBS中的方法嗎?
如果是的話,你可以將VBS文件作為resource引用進來,然後在QTP的腳本中就可以直接使用了。
或者QTP中有個叫ExecuteFile 的方法,你可以將VBS文件執行下,之後便可以使用了。

❸ QTP的2種腳本調用方法是什麼

QTP的2種腳本調用方法是什麼
我不知道你調用腳本是什麼概念?在QTP中調用外部腳本?還是啟動QTP腳本?
調用外部腳本,你可以採取VBS的程序去調用外部程序,或者你可以寫COM介面,然後再QTP的中調用!
啟動QTP腳本,你可以採取QTP的COM介面通過程序來調用
(3atesing有大量視頻專門介紹QTP的各類實用模式的)
QTP的COM調用可參考:
Set qtApp = CreateObject("QuickTest.Application") ' Create the Application object
qtApp.Launch ' Launch QuickTest
qtApp.Visible = True ' Set QuickTest to be visible
' Open a test and get the "Login" action's object repositories collection
qtApp.Open "C:\Tests\Test1", False, False ' Open a test
Set qtRepositories = qtApp.Test.Actions("Login").ObjectRepositories ' Get the object repositories collection object of the "Login" action
' Add MainApp.tsr if it's not already in the collection
If qtRepositories.Find("C:\MainApp.tsr") = -1 Then ' If the repository cannot be found in the collection
qtRepositories.Add "C:\MainApp.tsr", 1 ' Add the repository to the collection
End If
' If InnerWnd.tsr is moved down the list - place it back at position 1
If qtRepositories.Count > 1 And qtRepositories.Item(2) = "C:\InnerWnd.tsr" Then ' If there's more than one object repository and InnerWnd.tsr is in position 2
qtRepositories.MoveToPos 1, 2 ' Switch between the first two object repositories
End If
' If Debug.tsr is in the collection - remove it
lngPosition = qtRepositories.Find("C:\Debug.tsr") ' Try finding the Debug.tsr object repository
If lngPosition -1 Then ' If the object repository was found in the collection
qtRepositories.Remove lngPosition ' Remove it
End If
' Set the new object repository configuration as the default for all new actions
qtRepositories.SetAsDefault ' Set object repositories associated with the "Login" action as the default for all new actions
'Save the test and close QuickTest qtApp.Test.Save ' Save the test qtApp.Quit ' Quit QuickTest Set qtRepositories = Nothing ' Release the action's shared repositories collection Set qtApp = Nothing ' Release the Application object

熱點內容
如何配置全站時間同步系統 發布:2025-09-16 10:19:13 瀏覽:165
java解析json文件 發布:2025-09-16 10:10:41 瀏覽:966
車配置字母怎麼看 發布:2025-09-16 10:09:32 瀏覽:406
煙台電腦伺服器維修 發布:2025-09-16 10:08:45 瀏覽:266
編譯命令cl 發布:2025-09-16 09:57:21 瀏覽:518
小君直播密碼是多少 發布:2025-09-16 09:25:46 瀏覽:606
用中文編譯的編程軟體 發布:2025-09-16 09:04:37 瀏覽:148
語音編譯器教程 發布:2025-09-16 08:57:44 瀏覽:454
sql注冊伺服器 發布:2025-09-16 08:53:17 瀏覽:616
嵌入式linuxc編程入門 發布:2025-09-16 08:24:18 瀏覽:390