FindImagePos not working on VM

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Dman
Junior Coder
Posts: 26
Joined: Mon Apr 21, 2008 2:46 am
Location: Melbourne, Australia

FindImagePos not working on VM

Post by Dman » Wed Feb 06, 2013 12:53 am

I'm building some macros on a Win Server 2k8 R2 VM via console on vSphere Client 5.0

Whenever I try to use the FindImagePos function, it's always returning number found as 0 even though the captured BMP block is staring at me on the screen.

The exact same macros work when logged onto my local windows 7 machine, natively.

Really not sure whats causing this behavior? Maybe because the VM doesnt "draw" things as it should?

I tried increasing the tolerance to no avail.

I ended up finding a workaround it seems, doing a screencapture to a BMP, then doing a findimagepos on the BMP. NumFound then came up as 1.

The code for that is as follows:

Code: Select all

ScreenCapture>5,5,150,150>c:\mybmp.bmp
FindImagePos>c:\testimage.bmp,c:\mybmp.bmp,5,1,Xarr,Yarr,NumFound
MDL>%NumFound%
This isn't ideal but I understand it may be necessary. Is there something else I can try here to get FindImagePos working as it should? I'll be relying on static mousemove points if I use this method.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed Feb 06, 2013 1:23 am

Have You Tried The New Capture Method / Matching In v14? Maybe The Old Method The Image Doesn't Match Close Enough (Eg Being In The VM). Is The Macro Running On The VM Server Or Is It On Your Local Machine Then Trying To Match The Image Based On What The VM Is Displaying?
FIREFIGHTER

Dman
Junior Coder
Posts: 26
Joined: Mon Apr 21, 2008 2:46 am
Location: Melbourne, Australia

Post by Dman » Wed Feb 06, 2013 1:33 am

Am running Msched Pro 13.2.4 installed on the VM, not from my client machine.

I'm reluctant to install v14, already ran into some issues with it (by some, I mean one. An exception error) so gonna wait for a few more point releases.

User avatar
CyberCitizen
Automation Wizard
Posts: 721
Joined: Sun Jun 20, 2004 7:06 am
Location: Adelaide, South Australia

Post by CyberCitizen » Wed Feb 06, 2013 1:57 am

Hi Dman,

I am running v14.0.2, There Is v14.0.3 Which Has Resolved Some Issues, Not Sure About The Issue You Were Having, If You Wanted To Include Your Script And Images Your After I Could Compile It For You To Test.
FIREFIGHTER

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts