I'm writing a User-Acceptance & regression test pack and want to compare the screens obtained against a screenshot, saved as a bitmap (24 bit).
Here is the code I'm using:
<font color ='blue' >
Dim b As TBitmapCheck
Set b = BitmapCheck("bitmapcheck1")
b.AttachName = "Caption='Test Page'"
b.CaptureScreen = True 'capture entire screen
b.Bitmap = "c:\pages\new.bmp"
b.PixelThreshold = 2000000
b.CaptureData 'load the bitmap file
This returns false, even though the pixel threshold is greater than the total number of pixels on the screen. I've also tried more sensible values of the threshold, as well as 0 ,and the number of pixels on the screen (1280 * 1024). If I exclude the whole screen I get true however. I've also checked that .CaptureData method returns true.
I'm running on Windows 2003 server, using TP 5.2.0 GA Build 810, under VB 6.3 v9969, in case that is any help.If anyone has any suggestions to why this doesn't work, I'd be grateful.
Re: BitmapCheck problems
Without testing this myself, I would guess that your problem is the operating system. TP doesn't officially support Windows 2003 Server. I have only used TP in this environment once before and while most worked as expected, I did notice a couple oddities. If you can, try switching to a fully supported OS--windows xp, 2000 or NT4.0
Re: BitmapCheck problems
I'm currently automating tests for a .NET application using TP 5.2.1 on XP. Until now I have not encountered any problems.
I'm having similar problems to keefb checking for a small bitmap (a 14 pixel x 14 pixel exclamation mark).
The bitmap check works when I implement the check via the TestPartner Insert->Event mechanism. However, I want to be able to drive the bitmap checking from the script as keefb is above. The check fails when I try to implement the same check from the script.
Does anyone know of any obvious mistakes I may be making?
I've also tried to implement bitmap events from the script as follows:
Dim be As TBitmapEvent
Set be = BitmapEvent("exclamationEvent")
be.AttachName = "Application DotNETForm"
be.Bitmap = "C:\TEMP\exclamation.bmp"
be.Frequency = 3
be.Region 381, 274, 80, 80
If Wait(30, "exclamationEvent", pWaitSeconds) = True Then
TestLog.Comment "Event triggered"
TestLog.Comment "Event did not trigger, timeout of 30 seconds has been exceeded."
Including either the event name ("exclamationEvent") or the object name (be) both result in runtime errors.
Can anyone see the problem here?
Any help / advice greatly appreciated...