Jump to content

Recommended Posts

Posted

Hello all, I am at an impasse trying to move mouse to a specific element on a webpage, a button in this case, and clicking it (this would be the easy part).

The element is defined as followed:

id = "controls-4"

class = "set btn"

 

I am able to locate the element using the following lines:

    Local $oDiv = _IEGetObjById($oIE, "controls-4")
    MsgBox($MB_SYSTEMMODAL, "controls-4", $oDiv.innertext)

From here, I've tried the following lines, but all failed to move the mouse or click the element:

    Local $locDM = ControlGetPos("","",$oDiv)
    MouseMove($locDM[0],$locDM[1])
    _IEAction($oDiv, "click")

After storing the element to $oDiv, how should I go about using it to achieve what I want?

 

Thank you for your help in advance.

Posted

Hello,

Have you checked the content of the variable $locDM ?

I don't know if AutoIt built-in function ControlGetPos can deal with a web page element.

Posted

@dkim1017

Welcome to the forum.
Please read:
How to post code on the forum *   How to use IE.au3  UDF with  AutoIt v3.3.14.x  *

and please post here console output from this:

...
Local $oDiv = _IEGetObjById($oIE, "controls-4") 
_IEAction($oDiv, "click") 
....

 

mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

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...