Jump to content

IE Click by ID not working [Solved]


Recommended Posts

 

WinActivate("MEDITECH - Internet Explorer")
    Sleep (500)
$oIE = _IEAttach("MEDITECH")
$oDiv1 = _IEGetObjById($oIE, "sysmenu-searchbarbutton")
_IEAction($oDiv1, "click")

I am just trying to click the little magnifying glass, next to the gear button with no luck. I was hoping someone might have an idea why this is not working?

 

HTML3.thumb.PNG.a1ec028d04a47f34be241e1133cec206.PNG

Edited by SkysLastChance

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

Thank you for the response. 

No Errors in Scite Panel. 

If I click magnifying glass I get nothing in event viewer. If I click the search box section (highlighted in red on picture.) I get all of these.

I know I could do this with control send enter, but I am trying to get better at html. 

HTML4.thumb.PNG.eb9e0c03838fe99880c260fdea404e3c.PNG

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

Yes... it appears that you are correct. I didn't detect that when glancing at your earlier message.

This is probably going to be one of those times when it is difficult to assist you because we can't access the site to see exactly what it's doing. You could try saving the HTML to a file and posting it here as an attachment.

Link to comment
Share on other sites

Calling a click actionevent is something else then clicking with the mouse (which can trigger an event on a different element)

_IEAction($oDiv1, "click")

compare with

https://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm

So if you have the element you can calculate x,y / retrieve it with the IE functions and then mouseclick at the calculated location

see an example for mousemove in 

https://www.autoitscript.com/autoit3/docs/libfunctions/_IEPropertyGet.htm

 

Link to comment
Share on other sites

@junkews Thank you for the help. This worked perfectly. 

$oDiv1 = _IEGetObjById($oIE, "sysmenu-searchbarbutton")
   $iScreenX = _IEPropertyGet($oDiv1, "screenx")
   $iScreenY = _IEPropertyGet($oDiv1, "screeny")
   $iWidth = _IEPropertyGet($oDiv1, "width")
   $iHeight = _IEPropertyGet($oDiv1, "height")

   $iMousespeed = 30

   $oMouseCords = MouseMove($iScreenX + $iWidth / 2, $iScreenY + $iHeight / 2, $iMousespeed)
   MouseClick($MOUSE_CLICK_LEFT)

 

You miss 100% of the shots you don't take. -Wayne Gretzky -Michael Scott

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...