51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1058|回复: 0
打印 上一主题 下一主题

[求助] For help

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2007-12-19 10:00:54 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
大虾们帮忙看看下面代码有什么问题, 急!!!


'=======================================================================================================
'Function Name        :TransformationMainTree_OpenStepEditPage
'Description        :Open the Edit Step page from Main Tree Veiw
'Syntax                        :TransformationMainTree_OpenStepEditPage(StepName, LogMsg)   
'                                                                        StepName=>The step's name, which is under transformation main tree
'Example                :TransformationMainTree_OpenStepEditPage("Audit", LogMsg)
'Author                        :Gareth
'Create Date        :12/18/2007

Function        TransformationMainTree_OpenStepEditPage(StepName, LogMsg)

        ' Open the Transformation Main Tree first
        If Not MainTreeView.Exist(2) Then
                Call LeftTreeMenu_Open("Main Tree", "", LogMsg)
        End If

        MainTreeView.ExpandAll("Transformations")

        ' Get the Object's Name
        Call GetObjectName()
        Wait(2)

        MainTreeView.Select "Transformations;"&ObjectName&";Steps"
        Dim WshShell, StepSelection, i, j
        Set WshShell = CreateObject("WScript.Shell")
        i = 0

        'check the number of steps under Transformation Main Tree       
        While StepSelection<>"Transformations;"&ObjectName&";Hops"
                WshShell.SendKeys "{DOWN}"
                StepSelection = MainTreeView.GetROProperty("selection")
                ' i stands for  the times expressed by inputting the "DOWN" arrow from Keyboard.
        i = i+1
        Wend

        MainTreeView.Select "Transformations;"&ObjectName&";Steps"
        ' Check whether the step exists in the transformation main tree view
        For j = 0 To i
                WshShell.SendKeys "{DOWN}"
                StepSelection = MainTreeView.GetROProperty("selection")
                'If the step exists, then exit the cycle
                If StepSelection = "Transformations;"&ObjectName&";Steps;"&StepName  Then
                        LogMsg = "The step exists in the Transformation Main Tree View"
                        TransformationMainTree_OpenStepEditPage = "Pass|"&LogMsg
                        Reporter.ReportEvent 0, "TransformationMainTree_OpenStepEditPage", LogMsg
                End If
                Exit For
        Next

        'If the step not exists
    If StepSelection = "Transformations;"&ObjectName&";Hops" Then
                LogMsg = "The step is not existed in the Main Tee View"
                TransformationMainTree_OpenStepEditPage = "Fail|"&LogMsg
                Reporter.ReportEvent 1, "TransformationMainTree_OpenStepEditPage", LogMsg
                Exit Function
        Else
                'Open the edit step page by inputting "Enter" from keyboard
                MainTreeView.Type micReturn
        End If

        ' Check whether the Edit  step page dialog exists
        If WFDWindow.Dialog("regexpwndtitle:=.*").Exist(2) Then
                LogMsg = "Open the EditStepPage successfully"
                TransformationMainTree_OpenStepEditPage = "Pass|"&LogMsg
                Reporter.ReportEvent 0, "TransformationMainTree_OpenStepEditPage", LogMsg
        Else
                LogMsg = "Fails to open the EditStepPage"
                TransformationMainTree_OpenStepEditPage = "Fail|"&LogMsg
                Reporter.ReportEvent 1, "TransformationMainTree_OpenStepEditPage", LogMsg
        End If

End Function
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

本版积分规则

关闭

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

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

GMT+8, 2024-11-25 09:49 , Processed in 0.068064 second(s), 28 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

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