Jump to content
Sign in to follow this  
dadalt

Obtain a coord of a id; Click a closable button

Recommended Posts

dadalt

Hi!

I have a button where I need to close it!

I was doing through  clicking same position in screen but there are some id's that have different sizes.

What are the possible ways to click this closable button?

  • Is there a way to close it through id?
  • Is there a way to get it's position through it's ID?

 

Thanks in advance!

Capture.PNG

Capture1.PNG

Share this post


Link to post
Share on other sites
dadalt

This is my current solution:

For $ijk = -50 To 50 Step +1
        MouseClick($MOUSE_CLICK_LEFT, $kk[1] + $ijk, $kk[2], 1,0)
        MouseClick($MOUSE_CLICK_LEFT, $kk[1] + $ijk, $kk[2], 1,0)
      Next

 

Share this post


Link to post
Share on other sites
Danp2

A more detailed description of the situation would hopefully yield a better answer. For example, you could have provided the following information --

  • Browser name
  • Website's URL
  • etc

If you are using IE, you can retrieve a reference to the Div element with _IEGetObjById and then click it using _IEAction. If that doesn't work, then you'll need to provide additional information.

Share this post


Link to post
Share on other sites
dadalt
27 minutes ago, Danp2 said:

A more detailed description of the situation would hopefully yield a better answer. For example, you could have provided the following information --

  • Browser name
  • Website's URL
  • etc

If you are using IE, you can retrieve a reference to the Div element with _IEGetObjById and then click it using _IEAction. If that doesn't work, then you'll need to provide additional information.

I tried with _IEAction but that didn't work.

Here some information, ask if you need something more.

Browser name - IE

Title: http://www.consulta.plus/#!convenio - Internet Explorer

Share this post


Link to post
Share on other sites
dadalt

The entire script is pretty big, here are another try to click it:

 

Local $testando = _IEGetObjById ($oIE, "gwt-uid-59")
      Local $aPos1=ControlGetPos ( "http://www.consulta.plus/#!convenio - Internet Explorer", "", $testando )
      MsgBox($MB_SYSTEMMODAL, "", "Position: " & $aPos1)
      _IEAction($testando, "click")
      ;_IEAction($testando, "quit")
      _IEAction($testando, "delete")
      ;_IEAction($testando, "invisible")
      _IEAction($testando, "disable")

 

Share this post


Link to post
Share on other sites
Danp2

You've only told us that it doesn't work without providing any further context. The website requires a login, so we can't test this for you.

Post the results from the Scite output window so that we can see if the elements are being found, if any errors are occurring, etc.

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
Sign in to follow this  

  • Similar Content

    • XinYoung
      By XinYoung
      Quick question: How can I click this "Select All" button in IE? There's no ID, and the href is "#"  
      Am I looking at the wrong html code?
      Am I looking
      Thank you all in advance!
    • XinYoung
      By XinYoung
      Hello again 
      I need to click this Submit button, but it's in a lightbox and has no ID (i think) and I can't figure out a way to target it. _IEFormSubmit doesn't work.

       
      Thank you
    • lenclstr746
      By lenclstr746
      <span class="fr66n"><button class="dCJp8 afkep coreSpriteHeartOpen _0mzm-"><span class="glyphsSpriteHeart__outline__24__grey_9 u-__7" aria-label="Beğen"></span></button></span>
      I want to click this button ?
    • timmy2
      By timmy2
      I have the impression that the traditional method for processing responses to a GUI is to assign variables to each GUICreateButton (or Pic) and then use Switch/Case/Endswitch to detect when any Control is clicked.  In the tutorials I've seen about Koda it appears to use this method, too.
      While 1 Global $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Pic2 Call("verizon") Case $Pic3 Call("skype") Case $PicExit Exit EndSwitch WEnd But in a few examples I've seen a script use a different method. The script always includes the following option near the top:
      Opt("GUIOnEventMode", 1) ...and then, later, after creating each Control for the GUI, there's the function, GUICtrlSetOnEvent.  In these cases a very simple While/WEnd loop is used to wait for the user to respond. 
      I happened to employ this second method in a recent script where I used "canned" controls (checkbox and buttons). Later in the same script I used the GuiCreatePic and Switch/Case/EndSwitch method because my GUI was all custom images. (I'm not sure if that's necessary, but it's what I've deduced.) The second GUI failed to respond to any mouse clicks, but eventually I figured out the cause was the GUIOnEvenMode being enabled at the top of the script.
      This is when I realized I don't understand the reasoning behind choosing between these two methods. And I'm having no luck phrasing an appropriate search criterion. Is there an overview somewhere that explains the two methods and -- most importantly -- describes when each is appropriate?
    • nooneclose
      By nooneclose
      Hello again, I am in phase two of my help bot. I cannot figure out how to properly code Autoit to click on a webpage button using the I.E UDF. I want to click on the button that I have attached as an image. This button does not have a name but it has an ID. Here is the HTML code for this button that I found using chromes developer inspector.
      HTML Code: 
      <img role="button" tabindex="-1" id="toolactions_INSERT-tbb_image" src="nav_icon_insertkey.gif" alt="New Work Order CTRL+ALT+I" draggable="false"> Here is the code that I have so far:
      ;******************************************************************************* ; Opens IE and fill out a New Workorder ;******************************************************************************* ; Start IE at the ** Tracking Application in ****** $oIE = _IECreate("https:I_am_Bound_by_my_company_to_not_reveal_this_webpage") ; Wait for a browser page load to complete _IELoadWait($oIE) Sleep(6000) ; Store the field names where the important data will be sent Local $nWorkOrderB = _IEGetObjById($oIE, "toolactions_INSERT-tbb_image") _IEAction($nWorkOrderB, "click")  I want my program to click on the button that looks like a piece of paper with a blue # 
      (For those wondering, I am allowed to send images just not the URL.) 
      As always any help would be appreciated. 

×