Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20990

Find image in image fails

$
0
0

I'm trying to use the Find Image within Image feature of TestComplete but it always seems to fail. I have tried this with some very basic images but still can't get it to work, and I'm wondering if I am doing something wrong. 

 

I have the following basic Python code for this:

def FindImage():
  PaintImage = Aliases.Sys.mspaint.wndMSPaintApp.Picture()
  Log.Picture(PaintImage)
  CompImage = 'C:\\tmp\\tmp.jpg'
  rect = Utils.Rect
  rect = Regions.Find(PaintImage,CompImage)
  if rect is None:
    Log.Message("Not Found")

I originally tried to get this to work on a web application I am testing, but tried to revert to something very simple when that kept failing. I tried to just create a basic image in MS Paint and then took part of the image and tried to search for it. You can see the images here: http://imgur.com/a/uuz6F

 

I have tried debugging it to make sure that both images are actually being loaded successfully, and I can see each of the objects have the correct values in the Locals Panel. However the rect object is always empty.

 

Is there any reason that this should fail?


Viewing all articles
Browse latest Browse all 20990

Trending Articles