4 Test Case例子

    '############################################################################
    '# Test if we can create a document and later search out
    '# DESCRIPTION:
    '#
    '#

    '#
    '############################################################################
    Sub Test_Search_By_Properties(Property as String,Filter as String,Value as String)

    Call User_Login(NormalUser1, Password1)
    Call A_CreateDoc(TestPath1, DocName)
    Call A_Desktop_Focus()
    Call A_Desk_ClickTopPowerSearch()

    Call A_PowerSearch_Focus()
    Call APSrch_SelectProperty Property
    Call APSrch_SelectFilter Filter
    Call APSrch_General_InputValue Value

    Call APSrch_General_ClickAdd()
    Call APSrch_ClickSearch()

    Call A_Delay(10000)

    Dim Count As Interger
    Call Count = CommonUtil_GetListView_Count()
    If Count = 1 then
            Test_Log("Test_Search_By_Properties","Pass",CommonUtil_GetCurrenTimeStamp)
    Else
            Test_Log("Test_Search_By_Properties","Fail",CommonUtil_GetCurrenTimeStamp)
    End If

    Call A_DeleteFileAll()

    Call A_Logout()
    End Sub

  可以看到整个Case是可读可维护的,维护的成本也是比较小的。有编程基础的人通过写1-2个Case能熟悉框架,通过Debug几次能迅速定位错误。

  这是接触到的第一个自动化的框架...