Jump to content
SkysLastChance

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

Life's simple. You make choices and you don't look back.

Share this post


Link to post
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


Life's simple. You make choices and you don't look back.

Share this post


Link to post
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.

Share this post


Link to post
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

 

Share this post


Link to post
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)

 


Life's simple. You make choices and you don't look back.

Share this post


Link to post
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

  • Similar Content

    • By moimon
      Hi all. 
      Sorry if my words are confusing because I am not good at English.
      I am writing code to embed website with Recaptcha in GUI. And then, the code will automatically press the "I'm not a robot" button. The problem here is:
         - The code still works fine when entering iFrame to interact with Recaptcha with the URL is "https://www.google.com/recaptcha/api2/demo"
      <snip>
       
         - But for other URLs (such as "https://recaptcha-demo.appspot.com/recaptcha-v2-checkbox.php"), the code cannot be entered into the iframe.
       
      Code:
      <snip>  
      I did a lot of research but didn't know why.
       I sincerely thanks for the help. 
    • By SkysLastChance
      I am pretty sure the site that I am using was updated and now I am not seeing the same tags/elements that I used to. I tried using a UIAspy to see if I could grab them that way with no luck. 
      What do I need to do to be able to automate this again. Are the elements hidden somewhere?
      Instead of highlighting established account is highlights all of the web page almost. How can I get to the detail again? 
      I used to grab establish account by the name. Now I have nothing to even try to grab. 
      There are not elements in the event viewer either. 
       


       
      This is what happens when I try to inspect the element and click established account. 
      I get the same type of results in chrome
    • By wysocki
      I have a smartphone and I use it to access my email. However, when composing an email on it I have a problem. My list of phone contacts on the phone is very different from my list of email contacts in my Thunderbird desktop app.  I use my Gmail address book to store primarily phone contacts, and I use Thunderbird for my list of email contacts. I wanted a way to get my Thunderbird contact list onto my smartphone to be able to compose emails to addresses in that list. Here's my solution.
      I wrote a script to export my Thunderbird Personal Address Book to a csv file. It then reads that file and re-writes it with html wrappers around the data to make it into a nicely formatted web page. It then uploads the htm file to my website. On my smartphone, I created a shortcut to the file's URL and whenever I click it, I get the list displayed. Each contact shows name and email address along with a COPY button that will put the address into the clipboard. Then in my email client, I can easily paste that address into it. Alternatively, clicking on the actual email link will open a new message dialog in your email client with that address already entered.
      To use the app, all you need to do is use Thunderbird and have a webserver available. You'll need to download the FTPEX.AU3 file from this website and make a few changes to some constants around line 17 for FTP login info, etc.
       
      pab2ftp.au3
    • By SkysLastChance
      What would be the best way to grab the last digits of this <span>? One of the problems I know I am going to have is sometimes it will be 1 digit other times it might be 3. 

      I am trying to get the list of spans and I get this error.

       
      $oInputs = _IETagNameGetCollection($oIE, "span") $sTxt = "" For $oInput In $oInputs     $sTxt &= $oInput.Innertext & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Form Input Type", "Form: " & $oInput.form.name & @CRLF & @CRLF & "         Types :" & @CRLF & $sTxt)  
    • By yffulf
      Is there probably a way to click ie popup button and hide or invisible popup button in the same time?
      I try to use WinSetState @SW_hide ,
      the result is ie crashing or no response because button hide and the next click command won't work...
      $oForm=_IEFormGetObjByName($oIE,"form1") $obutton=_IEFormElementGetObjByName($oForm,"btn_OK") $hWnd = _IEPropertyGet($oIE, "hwnd") _IEAction($obutton,"focus") ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}") WinWait("", "確定存檔嗎?") WinSetState("","確定存檔嗎?",@SW_Hide) ControlClick("", "確定存檔嗎?", "[CLASS:Button; TEXT:確定; Instance:1;]")  
×
×
  • Create New...