51Testing软件测试论坛

标题: 解决在Test Set的快速执行时不能看到测试步骤描述问题!! [打印本页]

作者: johnjinwei    时间: 2007-3-7 09:41
标题: 解决在Test Set的快速执行时不能看到测试步骤描述问题!!
在建立Test Set后,第一次快速执行(Fast_Run)的时候,是无法看到测试用例的步骤描述。
但一般测试执行时,快速执行非常普遍,那样也可以减少查看用例描述时间。
现在我说明一下我的方法。
1.在WorkFlow的Command Bar Editor的Test Lab中建立一个Button,假设ACTION Name为TestLab_Run
2.在WorkFlow的Function TestLab_ActionCanExecute(ActionName)中加入如下代码:
If ActionName = "TestLab_Run" Then
' Get ID of current TestSet
TstSetId = CLng(TestSet_Fields.Field( "CY_CYCLE_ID").Value)
' Get current TestSet
Set TstSet = TDConnection.TestSetFactory.Item(TstSetId)
' Get TSTestFactory for current TestSet
Set TstSetTstFact = TstSet.TSTestFactory
' Get list of tests in test set
Set TstSetTstList = TstSetTstFact.NewList("")
  ' Loop through the test list
For Each tst in TstSetTstList
     Set  RunF=tst.RunFactory
     RunF.AddItem "Test"+RunF.UniqueRunName
Next
Set tst = Nothing
' Dispose of used objects
Set TstSetTstList = Nothing
Set TstSetTstFact = Nothing
Set TstSet = Nothing

'=================================================================

   Set com=TDConnection.Command
com.CommandText="insert into step select M.RN_RUN_ID as ST_RUN_ID,"&_
"M.DS_STEP_ID AS ST_STEP_ID,M.DS_STEP_NAME AS ST_STEP_Name, "&_
"'No Run'"&" as ST_STATUS,"&"'2000-01-01 00:00:00.000'"&" AS ST_EXECUTION_DATE, "&_
"'10:00:00'"&" AS ST_EXECUTION_TIME,M.DS_DESCRIPTION AS ST_DESCRIPTION,"&_
"M.DS_EXPECTED AS ST_EXPECTED,null as ST_ACTUAL ,NULL AS ST_PATH,NULL AS ST_LINE_NO,"&_
"NULL AS ST_USER_01,NULL AS ST_USER_02,NULL AS ST_USER_03,NULL AS ST_USER_04,"&_
"NULL AS ST_USER_05,NULL AS ST_USER_06,M.DS_STEP_ORDER as ST_STEP_ORDER,"&_
"NULL AS ST_DESSTEP_ID,NULL AS ST_ATTACHMENT, "&_
"M.RN_TEST_ID AS ST_TEST_ID,M.DS_STEP_ORDER AS ST_DESIGN_ID FROM "&_
"(select * from "&_
"(SELECT *  from run where RN_CYCLE_ID="&"'"&TstSetId&"'"&" and "&_
"RN_RUN_NAME LIKE "&"'%Test%'"&" and RN_RUN_ID not in (select ST_RUN_ID from step)) as M,"&_
"(SELECT * FROM DESSTEPS AS A, "&_
"(SELECT * FROM TEST WHERE TS_TEST_ID IN"&_
"(SELECT distinct RN_TEST_ID  from run where RN_CYCLE_ID="&"'"&TstSetId&"'"&"))"&_
" AS B  WHERE A.DS_TEST_ID=B.TS_TEST_ID) AS N "&_
"WHERE M.RN_TEST_ID=N.DS_TEST_ID) AS M "
MsgBox "You can View Test Step Via Last Run Result!"
   Set RecSet=com.Execute
   Set RecSet = Nothing
   Set com = Nothing
End IF
3.在TD中选中那Test Set,点那ACTION Name为TestLab_Run的Button.
4.那样就能在Last Run中看到解决。

一个非常实用和酷的功能吧。
有更好的方法,欢迎交流johnjin78@hotmail.com

[ 本帖最后由 johnjinwei 于 2007-3-9 16:13 编辑 ]
作者: junxijava    时间: 2007-9-20 18:07
这个功能确实很实用!支持一下




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2