qtp的专家视图中脚本的编写就是用的是vbs,不用特意什么格式,你只要语法正确就好
具体代码:
Dim MyFile,MyText
Set MyFile=CreateObject("Scripting.FileSystemObject")
Set MyText=MyFile.OpenTextFile(filename,2,True)
MyText.Write ......
MyText.Close
Set MyText=Nothing
MyFile.Close
Set MyFile=Nothing作者: mayuping0516 时间: 2008-11-18 09:03
Dim WshShell
Set WshShell=WScript.CreateObject("WScript.Shell")
WshShell.Run "notepad"
WScript.Sleep 2000
WshShell.SendKeys "This is a Test"
WScript.Sleep 1000
WshShell.SendKeys "^s"
WScript.Sleep 500
WshShell.SendKeys "test"
WshShell.SendKeys "%s"
WScript.Sleep 300
WshShell.SendKeys "%{F4}"