SilkTest打印功能学习笔记

上一篇 / 下一篇  2011-01-10 05:55:28 / 个人分类:SilkTest

Print("Print Text here: identifier.getcatpion()")
例如测试程序下有6个菜单,选“控制”再选“列表”,按“弹出”按钮。
[-] testcase printing()
 [-] recording
  [ ] 测试程序.SetActive ()
  [ ] 测试程序.控制C.列表框L.Pick ()
  [ ] 列表框.SetActive ()
  [ ] 列表框.弹出P.Click ()
  [ ] print("The caption of the button is {测试程序1.确定.getcaption()}")

输出:
[-] Testcase printing - Passed
 [ ] The caption of the button is 确定


ListPrint(identifier.getchild())打印出identifier里所有第一层child的内容
例如:
[-] testcase printing2()
 [-] recording
  [ ] 测试程序.SetActive()
  [ ] listprint(测试程序.getchildren())
输出:
[-] Testcase printing2 - Passed
 [ ] 测试程序.文件F
 [ ] 测试程序.控制C
 [ ] 测试程序.Menu5
 [ ] 测试程序.Menu("菜单(M)")
 [ ] 测试程序.Menu("禁用菜单")
 [ ] 测试程序.Menu("窗口(W)")


ResOpenList(sName) sName必须是string而且必须和ResCloseList()一起用
例如:
[-] testcase print3()
 [-] recording
  [ ] 测试程序.SetActive()
  [ ] resopenlist("This is the list of test application")
  [ ] listprint(测试程序.getchildren())
  [ ] rescloselist()
输出:
[-] Testcase printing3 - Passed
 [-] This is the list of test application
  [ ] 测试程序.文件F
  [ ] 测试程序.控制C
  [ ] 测试程序.Menu5
  [ ] 测试程序.Menu("菜单(M)")
  [ ] 测试程序.Menu("禁用菜单")
  [ ] 测试程序.Menu("窗口(W)")

可以把testcase printing3用resPrintList()用一行script来表示,
格式:
ResPrintList(sName,lSubItems)
sName必须是string, lSubItems必须是带有child或者subitem的集合
=the list of subitems that will be indented under sName in the result file - List of ANYTYPE.

例如:
ResPrintList("This is the list of test application:",测试程序.getchildren())
输出结果和以上testcase一样


TAG:

 

评分:0

我来说两句

Open Toolbar