51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2666|回复: 1
打印 上一主题 下一主题

[求助] 解决在Test Set的快速执行时不能看到测试步骤描述问题!!

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2007-3-7 09:41:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
在建立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 编辑 ]
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2007-9-20 18:07:04 | 只看该作者
这个功能确实很实用!支持一下
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-10-1 19:24 , Processed in 0.074901 second(s), 27 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表