當前位置:首頁 » 編程軟體 » 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-17 18:01:06 瀏覽:757
手機只上微信要什麼配置 發布:2025-09-17 17:56:19 瀏覽:693
什麼叫配置高的電腦 發布:2025-09-17 17:53:15 瀏覽:571
php考試系統源碼 發布:2025-09-17 17:52:27 瀏覽:824
打牌的演算法 發布:2025-09-17 17:37:46 瀏覽:174
ftp和ssh什麼意思 發布:2025-09-17 16:46:18 瀏覽:501
安卓如何限定應用 發布:2025-09-17 16:35:50 瀏覽:386
pythoncmd退出命令 發布:2025-09-17 16:16:33 瀏覽:927
朗動頂配是什麼配置 發布:2025-09-17 16:08:35 瀏覽:446
小孩子學習編程 發布:2025-09-17 16:05:12 瀏覽:122