唯一纯白的梦里花,盛开在琥珀色月牙,就算是去所有爱的力量,我也不曾害怕!-------本站点部分文章来自网络,如果涉及到版权问题请与本人联系,本人将及时删除

1、TD模板制作示例

上一篇 / 下一篇  2007-01-19 14:25:56 / 天气: 舒适 / 心情: 平静 / 精华(1) / 置顶(1) / 个人分类:TD

nQa-J!doBKt0                                    TD模板制作示例51Testing软件测试网7B+K9lBd&\h T
设置步骤:
&\U"Unr&j H:M01.用管理员身份进入到要应用模板的项目中。51Testing软件测试网_F~@ l1sr Xr$lw
2.点击Set Up WolkFlow设置工作流。51Testing软件测试网0wi,gL;Nf
3.以下的模板设置都在脚本设计器中进行设计。

r9B*_nY!^"k(w0

sXjP0ZuK"W]!F5f0'****以下三个方法写在Test Plan module scrīpt模块中*********

;Sp Qx)R sEr0

$S?/|;\3c_4k$p0'******新增测试用例(Test Plan)模板********
{ o$a Bv w.~3e.Q0Sub TestPlan_Test_New
&pA\$LT3l0  On Error Resume Next51Testing软件测试网.XhkY4s

51Testing软件测试网z"P`4Yt*?"AL{"c

  Test_Fields("TS_DEscrīptION").Value="[测试目标]"+chr(13)+chr(13)
/`g;x~3I.NO7w@ H0  Test_Fields("TS_DEscrīptION").Value=Test_Fields("TS_DEscrīptION").Value+"[前置条件]"+chr(13)+chr(13)
Gk(O1g8sxo^2u$T ~0  Test_Fields("TS_DEscrīptION").Value=Test_Fields("TS_DEscrīptION").Value+"[数据准备]"+chr(13)51Testing软件测试网2C4pG%p_7p,W X
  Test_Fields("TS_DEscrīptION").Value=Test_Fields("TS_DEscrīptION").Value+chr(32)
6@ye9M;Ug0 
P YV3Xf*F0  On Error GoTo 051Testing软件测试网$E+?u*C f4W1V
End Sub51Testing软件测试网1m1lI#y S)IY1W

Y0f vaNU7Jc'NV e7[o"q051Testing软件测试网!@j7{6Z:\5p9]\E
'*****新增测试步骤(Test Step)模板**************
A5]m Xjv.e0'*******以下New方法是用户自定义方法*********51Testing软件测试网 [~I B.j[H
Sub TestPlan_DesignStep_New51Testing软件测试网 H-p n g9UW1m+Xgm
  On Error Resume Next51Testing软件测试网rVL*if8LK

;U}(eng)s0 DesignStep_Fields("DS_DEscrīptION").Value="[操作描述]"51Testing软件测试网)r!s)P+f _e
 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value +chr(10)+chr(13)
)j&L9cK5G:VJ&p j0 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value+"[输入数据]"
K)F2Tu _/^0r"K;}0 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value +chr(10)51Testing软件测试网2r(an%p$h
 DesignStep_Fields("DS_DEscrīptION").Value=DesignStep_Fields("DS_DEscrīptION").Value +chr(32)51Testing软件测试网,d o9q*f3lH j
 DesignStep_Fields("DS_EXPECTED").Value="[预期结果]"
OJq+f0U.Nb0 DesignStep_Fields("DS_EXPECTED").Value=  DesignStep_Fields("DS_EXPECTED").Value+chr(10)
CIDC-aI0 DesignStep_Fields("DS_EXPECTED").Value=  DesignStep_Fields("DS_EXPECTED").Value+chr(32)51Testing软件测试网O;br7rc qG ol1u

J*~/Vs9wl0  On Error GoTo 0
3yf0K#@b;aW0End Sub51Testing软件测试网3ctz M3dSH} b
'********系统调用的是MoveTo方法***********
Pm5l0[&_E1Z M0Sub TestPlan_DesignStep_MoveTo
)I E0wYt@0  On Error Resume Next51Testing软件测试网G4v R3X[}e }m
   dim Temp51Testing软件测试网4Pe4\s*n!b
   Temp=DesignStep_Fields("DS_DEscrīptION").Value51Testing软件测试网6Yvm-C7gU
   if Trim(Temp)="" then
w I e K bMv0    TestPlan_DesignStep_New51Testing软件测试网zo"txA S?HN
   end if

qM3r9k5w'yO"C051Testing软件测试网$M:{+KU-a6s e

  On Error GoTo 051Testing软件测试网Kl"mz%cD?P}
End Sub51Testing软件测试网W8\T-M/s.r3d
'说明:TD系统在新增Step步骤时是调用TestPlan_DesignStep_MoveTo 方法,所以不能把模板事情写在该方法中。
UdN&XgIM9Z GU0'而应该先判断DesignSteps("DS_DEscrīptION").Value是否为空,
ty y%t9R4BC0'如果非空的话,说明该步骤已经是存在的,不应该应用该模板,当然如果为空的话,则说明该步骤可以应用新模板,则调用用户自定义的New方法。51Testing软件测试网HsFZ.k d

k0K7J+V8O+b L(e p051Testing软件测试网C&}Qq#E9f+r:S!O-l
'********以下方法写在Defects module scrīpt模块中**********

O/oug!Y/l-t*e0

R A6c(B.k'i$XH0'********新增Bug模板************51Testing软件测试网p6[l5hN"GH
Sub Defects_Bug_New51Testing软件测试网B s!N|4~4JYw m
  On Error Resume Next51Testing软件测试网0XX1\:a@ H
 Bug_Fields("BG_DEscrīptION").Value="[模块路径] >> >>" +chr(13)+chr(13)
:x.R)b\\*it8jw%d0 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[问题描述]" +chr(13)
!i$\J3J&A3hr^0 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"1." +chr(13)
O:QA,_2q.\-el0 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"2." +chr(13)51Testing软件测试网7@"o5p4x:C8aQ
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[实际结果]" +chr(13)+chr(13)
Tf}T Z#^?0 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[预期结果/解决方法]" +chr(13)+chr(13)
2u3b w LEA0 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+"[备注]" +chr(13)51Testing软件测试网4R.\Hn ov5d
 Bug_Fields("BG_DEscrīptION").Value=Bug_Fields("BG_DEscrīptION").Value+chr(32)51Testing软件测试网onR n7u^&P

51Testing软件测试网$~ T6?3_F2h SP

  On Error GoTo 0
DW j i2v)O"Bf/T0End Sub51Testing软件测试网7GO+q2HL7tyt

'KbY c$ETo c,c#o0'备注说明:脚本中有用到一些字符的 chr(10) 换行≈chr(13) 回车 chr(32) 空格

.X.Y"Zko4k0

TAG: TD

 

评分:0

我来说两句

Open Toolbar