QTP基础代码收集《一》
来源:互联网 发布:linux 多系统开机过程 编辑:程序博客网 时间:2024/06/14 10:57
1、 将 bug 添加到QC
Dim TDConnection
Set TDConnection =CreateObject("TDApiOle.TDConnection")
TDConnection.InitConnection"http://yovav/tdbin" ' URL for the DB
TDConnection.ConnectProject"TD76","bella","pino" ' Valid login information
If TDConnection.ConnectedThen
MsgBox("Connected to " + chr(13) + "Server " + TDConnection.ServerName _
+ chr (13) +"Project " +TDConnection.ProjectName )
Else
MsgBox("Not Connected")
End If
'Get the IBugFactory
Set BugFactory =TDConnection.BugFactory
'Add a new empty bug
Set Bug = BugFactory.AddItem(Nothing)
'fill the bug with relevantparameters
Bug.Status = "New"
Bug.Summary = "Connecting toTD"
Bug.Priority = "4-Very High" 'depends on the DB
Bug.AssignedTo = "admin" ' userthat must exist in the DB's users list
Bug.DetectedBy = "admin" ' userthat must exist in the DB's users list
'Post the bug to DB ( commit)
Bug.Post
2、 文件操作函数集:
' Creates a specified file and returns a TextStream object that canbe used to read from or write to the file.
' Example of usage
' Set f =CreateFile("d:\temp\beenhere.txt", True)
' f.WriteLine Now
' f.Close
Function CreateFile(sFilename,bOverwrite)
Set fso =CreateObject("scrīpting.FileSystemObject")
Set CreateFile =fso.CreateTextFile(sFilename, bOverwrite)
End Function
' Opens a specified file andreturns a TextStream object that can be used to read from, writeto, or append to the file.
' iomode: 1 - ForReading, 2 -ForWriting, 8 - ForAppending
' Example of usage
' Set f =OpenFile("d:\temp\beenhere.txt", 2, True)
' f.WriteLine Now
' f.Close
Function OpenFile(sFilename, iomode, create)
Set fso =CreateObject("scrīpting.FileSystemObject")
Set ōpenFile =fso.OpenTextFile(sFilename, iomode, create)
End Function
' Appends a line to afile
' Example of usage
' AppendToFile"d:\temp\beenhere.txt", Now
FunctionAppendToFile(sFilename, sLine)
Const ForAppending = 8
If sFilename = "" Then
sFilename =Environment("SystemTempDir") & "\QTDebug.txt"
End If
Set f = OpenFile(sFilename,ForAppending, True)
f.WriteLine sLine
f.Close
End Function
' Writes a line to afile.
' Destroys the current contentof the file!
' Example of usage
' WriteToFile"d:\temp\beenhere.txt", Now
Function WriteToFile(sFilename,sLine)
Const ForWriting = 2
If sFilename = "" Then
sFilename =Environment("SystemTempDir") & "\QTDebug.txt"
End If
Set f = OpenFile(sFilename,ForWriting, True)
f.WriteLine sLine
f.Close
End Function
2、 文件操作函数集:
' Creates a specified file and returns a TextStream object that canbe used to read from or write to the file.
Function OpenFile(sFilename, iomode, create)
0 0
- QTP基础代码收集《一》
- QTP基础代码收集《一》
- QTP基础代码收集《一》
- QTP基础代码收集《一》
- QTP基础代码收集《二》
- QTP基础代码收集《二》
- QTP基础代码收集《二》
- QTP基础代码收集《二》
- QTP基础代码收集《三》
- QTP基础代码收集《三》
- QTP基础代码收集《三》
- QTP基础代码收集《三》
- QTP基础代码(一)
- 收集的qtp经典代码
- QTP的基础代码
- qtp基础代码
- QTP基础代码结构累积
- QTP中一些基础代码结构累积
- QTP数据库检查和WEB表格数据检查
- QTP数据库检查和WEB表格数据检查
- QTP数据库检查和WEB表格数据检查
- <转>QTP数据库检查和WEB表格…
- QTP基础代码收集《一》
- QTP基础代码收集《一》
- QTP基础代码收集《一》
- QTP基础代码收集《一》
- QTP基础代码收集《二》
- QTP基础代码收集《二》
- QTP基础代码收集《二》
- QTP基础代码收集《二》
- 对extjs封装+SSI快速生成CURD和报表
- QTP基础代码收集《三》