是否可以在描述性编程中进行位图检查点? HP-UFT 14

时间:2017-09-21 11:30:32

标签: vbscript hp-uft

您好我想知道在描述性编程中是否可以进行位图检查点,因为我在多个页面中处理相同的图像

2 个答案:

答案 0 :(得分:2)

'Test Code
SystemUtil.CloseProcessByWndTitle("HPE MyFlight Sample Application")
SystemUtil.Run "C:\Program Files (x86)\HP\Unified Functional Testing\samples\Flights Application\FlightsGUI.exe"
Window("regexpwndtitle:=HPE MyFlight Sample Application").WaitProperty "visible",True
Window("regexpwndtitle:=HPE MyFlight Sample Application").CaptureBitmap "C:\Expected.bmp",True
Window("regexpwndtitle:=HPE MyFlight Sample Application").CaptureBitmap "C:\Actual.bmp",True
Msgbox CompareBitMapFiles("C:\Actual.bmp","C:\Expected.bmp")

Public Function CompareBitMapFiles(ByVal ExpectedImage,ByVal ActualImage)
    Dim objFileCompare
    Dim blnIsEqual
    Dim strFileComparisonValue : strFileComparisonValue = "Not Equal"
    Set objFileCompare = CreateObject("Mercury.FileCompare")
    blnIsEqual = objFileCompare.IsEqualBin(ExpectedImage,ActualImage,0,1)
    If blnIsEqual Then
        strFileComparisonValue = "Equal"
    End If
    CompareBitMapFiles = strFileComparisonValue
End Function

另一个命令行工具是here

答案 1 :(得分:1)