0

I have tried a lot in finding out how measure the coordinate of an element in a web page in different browser.But I could not find any solution.

Is there any other tool that can measure the position of an element in various browsers???

1 Answers1

1

In AutoIt you can use the following code to get screen coordinates (in my example for displaying a tool tip as an overlay on an Internet Explorer):

$oIE = _IECreate("http://...URL...")
$username = _IEFormElementGetObjByName(_IEFormGetObjByName($oIE, "loginform"), "username")
ToolTip("Login", _IEPropertyGet($username, "screenx"), _IEPropertyGet($username, "screeny"))
_IEAction($username, "focus")

Alternatively you can use _IEGetObjById($oIE, "mx77") to get an object reference. Or run through all all elemnts by tag name as shown here. Instead of getting the absolute screen position, you can get the In-Browser-Position, using browserx and browsery.

Community
  • 1
  • 1
Samoth
  • 1,691
  • 17
  • 24