Jump to content

Recommended Posts

Posted

I've got a pesky checkbox in a login window (the vSphere Client login window) that causes AutoIt's controlCommandIsChecked to always return false regardless of if the box is checked or not. Thus, I decided to resort to performing a pixel checksum on the checkbox's control to determine if it's checked or not based on the checksum value. I must be doing something wrong though because it's not computing the checksum of the appropriate area at all. Here's what I came up with (I'm using Java) ...

AutoItX autoIt = new AutoItX();
String loginWindow = "VMware vSphere Client";

double pchecksum = autoIt.pixelChecksum(autoIt.controlGetPosX(loginWindow, "", "[NAME:checkUsePassthrough]"), +
    autoIt.controlGetPosY(loginWindow, "", "[NAME:checkUsePassthrough]"), +
    autoIt.controlGetPosX(loginWindow, "", "[NAME:checkUsePassthrough]")+autoIt.controlGetPosWidth(loginWindow, "", "[NAME:checkUsePassthrough]"), +
    autoIt.controlGetPosY(loginWindow, "", "[NAME:checkUsePassthrough]")+autoIt.controlGetPosHeight(loginWindow, "", "[NAME:checkUsePassthrough]")));

Any suggestions as to what I'm doing wrong here in capturing the coordinates of the control to compute the pixel checksum?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...