没有合适的资源?快使用搜索试试~ 我知道了~
testcomplete常用函数库
5星 · 超过95%的资源 需积分: 10 37 下载量 63 浏览量
2011-06-02
20:20:29
上传
评论 1
收藏 6KB TXT 举报
温馨提示
试读
10页
这是testcomplete使用中常用的函数,包括以下内容: '得到当前时间 '读配置文件 '判断文件是否存在 '打开批量受理的excel文件,写入一个数组到指定的起止位置 '执行sql语句 '执行sql语句得到多列单行多个返回 '执行sql语句得到的是多行返回结果 '执行存储过程得到返回 '读键盘输入,用于人工干预代码执行时
资源推荐
资源详情
资源评论
'得到当前时间
Function FstrNow()
Utilities.DateTimeToString FstrNow,"yyyy-mm-dd hh:nn:ss",Utilities.Now()
End Function
'读配置文件
'INI文件例子:
'[DO_SUBS_CODE]
'SUB1=001.txt
'[Root]
Function FstrReadIni(strIniFile,strSection,strOption)
Set w = Storages.INI(strIniFile)
Set Section = w.GetSubSection(strSection)
FstrReadIni=Section.GetOption(strOption,"")
End Function
'判断文件是否存在
'例子: if lib.FblnFileExist(Project.Path + "001.xlsx") then
Function FblnFileExist(strFile)
If Not aqFile.Exists(strFile) Then
FblnFileExist=False
Else
FblnFileExist=True
End If
End Function
Function FstrNow()
Utilities.DateTimeToString FstrNow,"yyyy-mm-dd hh:nn:ss",Utilities.Now()
End Function
'读配置文件
'INI文件例子:
'[DO_SUBS_CODE]
'SUB1=001.txt
'[Root]
Function FstrReadIni(strIniFile,strSection,strOption)
Set w = Storages.INI(strIniFile)
Set Section = w.GetSubSection(strSection)
FstrReadIni=Section.GetOption(strOption,"")
End Function
'判断文件是否存在
'例子: if lib.FblnFileExist(Project.Path + "001.xlsx") then
Function FblnFileExist(strFile)
If Not aqFile.Exists(strFile) Then
FblnFileExist=False
Else
FblnFileExist=True
End If
End Function
'打开批量受理的excel文件,写入一个数组到指定的起止位置
Function FblnWrite2xls(strXlsFile,lngXstart,lngYstart,arrData)
Dim excel
Dim MsExcel
Dim i,j
FblnWrite2xls=false
Set excel = Sys.WaitProcess("EXCEL")
If excel.Exists Then
Call excel.Terminate()
End If
on error resume next
Set MsExcel = Sys.OleObject("Excel.Application")
if Err.Number <> 0 then
call Log.Warning("初始化 MS Excel 失败", "", pmHigher)
FblnWrite2xls=False
exit Function
end if
if not FblnFileExist(strXlsFile) then
Log.Warning(strXlsFile & " 不存在")
FblnWrite2xls=False
exit Function
End If
剩余9页未读,继续阅读
LANDEHUTU
- 粉丝: 4
- 资源: 10
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页