一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

QTP調(diào)用外部應(yīng)用程序的4種方法 - [自動(dòng)化測(cè)試]

 楊柳1234 2011-01-07
版權(quán)聲明:轉(zhuǎn)載時(shí)請(qǐng)以超鏈接形式標(biāo)明文章原始出處和作者信息及本聲明 http://17testing./logs/61388898.html 方法 1. 使用 "InvokeApplication" 命令調(diào)用可執(zhí)行應(yīng)用程序 Note: In most situations, you should use a SystemUtil.Run statement to run applications or to open files in their default application. The InvokeApplication statement is supported primarily for backward compatibility. 例子: InvokeApplication "E:\Program Files\Internet Explorer\IEXPLORE.EXE" 方法 2. 使用 "SystemUtil.Run" 命令打開(kāi)一個(gè)文件或應(yīng)用程序 When specifying a non-executable file, the file opens in the associated application. Note: A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a test. Tip: You can also use this method to perform operations on the specified file, similar to the usage of the Windows ShellExecute command. 例子: SystemUtil.Run “IEXPLORE.EXE” 注意:SystemUtil.Run 和 InvokeApplication的區(qū)別在于是否需要指定完整路徑 例: Open a Text File in the Default Text Application (Notepad) Sub CloseDescendentProcesses_Example() 'The following example uses the Run method to open a file named type.txt 'in the default text application (Notepad). It then types "happy days", 'saves the file using shortcut keys, and then closes the application. SystemUtil.Run "C:\type.txt", "", "", "" Window("Text:=type.txt - Notepad").Type "happy days" Window("Text:=type.txt - Notepad").Type micAltDwn & "F" & micAltUp Window("Text:=type.txt - Notepad").Type micLShiftDwn & "S" & micLShiftUp Window("Text:=type.txt - Notepad").Close End Sub 方法 3. 使用ExecuteFile 函數(shù)執(zhí)行外部定義的函數(shù) If you decide not to associate a function library (any VBScript file) with a test, but do want to be able to call its functions, subroutines, and so forth from an action in your test or from another function library, you can do so by inserting an ExecuteFile statement in your action. When you run your test, the ExecuteFile statement executes all global code in the function library making all definitions in the file available from the global scope of the action's script. 注意:用ExecuteFile語(yǔ)句執(zhí)行的函數(shù)文件是不能被QTP調(diào)試進(jìn)去的 (You cannot debug a file that is called using an ExecuteFile statement, or any of the functions contained in the file. In addition, when debugging a test that contains an ExecuteFile statement, the execution marker may not be correctly displayed. ) To execute an externally-defined function: 1. Create a VBScript file using standard VBScript syntax. For more information, see the Microsoft VBScript Language Reference (Help > QuickTest Professional Help > VBScript Reference > VBScript). 2. Store the file in any folder that you can access from the computer running your test. 3. Add an ExecuteFile statement to an action in your test using the following syntax: ExecuteFile FileName where FileName is the absolute or relative path of your VBScript file. 4. Use the functions, subroutines, and so forth, from the specified VBScript file as necessary in your action. 方法 4. 使用 "WshShell.Exec" 方法 - Runs an application in a child command-shell, providing access to the StdIn/StdOut/StdErr streams. Remarks The Exec method returns a WshScriptExec object, which provides status and error information about a script run with Exec along with access to the StdIn, StdOut, and StdErr channels. The Exec method allows the execution of command line applications only. The Exec method cannot be used to run remote scripts. Do not confuse the Exec method with the Execute method (of the WshRemote object). 例子: Dim WshShell, oExec Set WshShell = CreateObject("WScript.Shell") Set oExec = WshShell.Exec("calc") Do While oExec.Status = 0 WScript.Sleep 100 Loop WScript.Echo oExec.Status

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類(lèi)似文章 更多

    亚洲一区二区三区在线中文字幕| 东京热电东京热一区二区三区| 五月激情婷婷丁香六月网| 午夜小视频成人免费看| 日本人妻精品有码字幕| 91香蕉国产观看免费人人| 国产精品九九九一区二区| 国产中文字幕久久黄色片| 大香蕉久草网一区二区三区 | 欧洲一区二区三区蜜桃| 国产又黄又爽又粗视频在线| 国产不卡视频一区在线| 色婷婷视频国产一区视频| 国产中文字幕一二三区| 字幕日本欧美一区二区| 日韩特级黄片免费在线观看| 国产精品亚洲综合天堂夜夜| 国产一区麻豆水好多高潮| 内射精品欧美一区二区三区久久久| 熟女少妇一区二区三区蜜桃| 美女被草的视频在线观看| 婷婷开心五月亚洲综合| 国产av天堂一区二区三区粉嫩| 日本最新不卡免费一区二区| 少妇被粗大进猛进出处故事| 亚洲天堂一区在线播放| 亚洲性日韩精品一区二区| 国产综合欧美日韩在线精品| 免费黄色一区二区三区| 国产精品蜜桃久久一区二区| 久久精品中文字幕人妻中文| 久久精品欧美一区二区三不卡| 绝望的校花花间淫事2| 一区二区免费视频中文乱码国产| 日本理论片午夜在线观看| 后入美臀少妇一区二区| 精品国自产拍天天青青草原| 国产内射一级二级三级| 欧美中文字幕日韩精品| 九九热视频免费在线视频| 91麻豆精品欧美视频|