手把手教你TestComplete_杂七杂八

来源:互联网 发布:iphone事件提醒软件 编辑:程序博客网 时间:2024/04/30 20:50

 

 

 

 

 本文零敲碎打的罗列了一些内容,供大家参考:


一.        得到当前的时间
Function FstrNow()
    Utilities.DateTimeToString FstrNow,"yyyy-mm-dd hh:nn:ss",Utilities.Now()
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



三.多人合作

当有多人共同完成一个项目,各人完成的部分脚本操作对象可能和其他人的脚本有重复的问题,那NameMapping就各自有一个,合并还是分开?这是个问题。

如果分开的话,就可以建立一个projectsuite,各人建立一个project,将来要全部执行的时候,就直接执行projectsuite,各个project之间可以使用projectsuite变量来进行交互,或者使用文件方式交互。这样就可以不互相干扰,各人做各人的。

如果人数不太多,可以一边做一边合并Namemapping,这是TestComplete7以后提供的功能

方法:右键namemapping,在弹出菜单中选择merge with,然后就可以选择对方的映射名称文件进行合并了。



四.记录出错时候的情形

菜单:Tools—default project properties

 

 

Post image on error
If this options is enabled, TestComplete makes a screenshot of the screen and saves it to the log when an error occurs.

出错时记录图片:
如果选择了该项,TestComplete会在日志中记录一个错误发生时的屏幕快照。

如果想自己手工记录,可以试试:
Log.Picture(Sys.Desktop.Picture)



有好的内容会持续添加。

 

 

 

 

原创粉丝点击