51Testing软件测试论坛

标题: TD的WorkFlow定制,遇到问题之二(设置Defect Details对话框自动弹出问题),请指教 [打印本页]

作者: caijie0304    时间: 2006-3-2 20:14
标题: TD的WorkFlow定制,遇到问题之二(设置Defect Details对话框自动弹出问题),请指教
TD的WorkFlow定制缺陷跟踪流程,遇到问题之二(设置Defect Details对话框自动弹出问题):
我查看TD的帮助文件,其中提供了一个设置BUG记录间切换时,Defect Details对话框自动弹出的方法,如下:
---------------------------------------------
Understanding the Action Object
When writing a script in the Script Editor, you can use the Action object to verify whether a button or command is enabled, checked, or visible. You can also use it to execute actions. For example, suppose you want the Defect Details dialog box to open automatically when you move from one defect to another in the Defects Grid. In the Defects_Bug_MoveTo event, you can use the following code:

NewDefectAction=Actions.Action(“DefectDetailsAction1”)
#Defect Details opens after executing the next line
NewDefectAction.Execute
-----------------------------------------------------------------------------------

但我试验后,却发现系统报错:
A failure has occured in the workflow script(in function <Defects_Bug_MoveTo>)
---------------------
Error at Line 357, (character 5)
"DefectDetailsAction1" is not a valid action.:
====================
    Sub Defects_Bug_MoveTo
==> NewDefectAction=Actions.Action("DefectDetailsAction1")
    'NewDefectAction=Actions.Action("BugAddAction1")
====================

即系统提示DefectDetailsAction1不合法。
下面类似语句
NewDefectAction=Actions.Action(“BugAddAction1”)
NewDefectAction.Execute      可以实现自动弹出新增BUG的对话框

因此说明方法是对的,但帮助中写的Defect Details对话框对应的Action名DefectDetailsAction1不对。
请问,那位知道Defect Details对话框对应的Action名应该是什么?
最好能给予彻底的帮助,告诉我哪里能查到TD中各对话框对应的Action名(授我以渔)。
作者: dingding2011    时间: 2011-7-19 09:47
所有的action名字可以使用这样的方法获得,就是到脚本编辑器中的  Requirements_ActionCanExecute(ActionName)   事件里写入 msgbox  ActionName 如:
Function Requirements_ActionCanExecute(ActionName)
  On Error Resume Next
   MsgBox ActionName
End If

保存后,你再去点击你想知道的按钮,你就可以知道这个按钮对应的actionname是什么。用完后,把这个msgbox写法去掉。




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