Jump to content

Recommended Posts

Posted

I need help to click the DRAW button.  See attached.  The first few lines inserts the 1 in the mi box.  Now I need to click the DRAW button.

$oIE = _IEAttach ("http://paragonmls.sandicor.com/ParagonLS/Default.mvc", "URL")

 Local $oFrame = _IEFrameGetCollection($oIE, 0)
 Local $hWnd = _IEPropertyGet($oIE, "hwnd")
 Local $oQuery = _IEGetObjById($oFrame, "jqMpCntlTopMenuDrawRadius")
 $oQuery.value = "1" ; Works and replaces mi with 1
 
 ;*****************Trying to click the Draw button*************************
 Local $oQuery = _IEGetObjById($oFrame, "jqMpCntlTopMenuActionDrawRadius" )
 
 _IEAction($oQuery, "click")  ; Doesn't Work I only use one of these lines at a time but neither work.
 ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:8]", "{Enter}") ;Doesn't Work

I used chome to show the content since it does better than IE11.Draw_Button.thumb.jpg.02a81cffb6f493e57b

Posted

You can use my signature to grab it.  Your xpath would be:

$xpath = "//li/div[.='draw']"

; if the above returns multiple objects, you can get more specific like
$xpath = '//li/div[@data-action="DrawRadius" and .="draw"]'

 

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Posted

Mikell, using your suggestion I did:

$oIE = _IEAttach ("http://paragonmls.sandicor.com/ParagonLS/Default.mvc", "URL")

Local $oFrame = _IEFrameGetCollection($oIE, 0)

$oElements = _IETagNameGetCollection($oFrame, "li")
  For $oElement In $oElements
  If $oElement.id = "jqMpCntlTopMenuActionDrawRadius" Then
      If $oElement.id Then ConsoleWrite("Tagname: " & $oElement.tagname & @CRLF & "id: " & $oElement.id & @CRLF & "innerText: " & $oElement.innerText  & @CRLF & "Attribute: " & $oElement.GetAttribute & @CRLF)
   EndIf
I get:

Tagname: LI
id: jqMpCntlTopMenuActionDrawRadius
innerText: draw
Attribute:

Now how do I click on it?  $oElement.click does not work.

Junkew: I am filling in information and now I need to click the draw button.

Jdelaney: I will have to studying xpath since I have not heard of it before now.  If you grab it, how do you click it?

 

Posted

Hmm you didn't read my post closely enough, I mentioned the div (the one inside the li)
Look at the classnames : 
li => jqMpCntlTopMenListItm = list item
div => jqMpCntlTopMenuBtn = button
Not sure it will work of course but it's worth a try   :)

$oDivs = _IETagNameGetCollection($oFrame, "div")
For $oDiv In $oDivs
  If StringInStr(oDiv.classname, "jqMpCntlTopMenuBtn") and $oDiv.innertext = "draw" Then
     _IEAction($oDiv, "click")
  EndIf
Next

 

Posted

@whanenbu

Please use code tags when you post your code.

You can also edit your old post , you can read about here.

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

Posted

Mikell, it works.  Thank you very much.  I did need to fix the syntax error of the missing $ but that was no issue.  You figuring this out is amazing.  Again thanks.

Posted (edited)

Just an FYI, my sig does all the loops for you.  The xpath for what mikell provided would be:

$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE,"//div[@class='jqMpCntlTopMenuBtn' and .='draw']")
If IsArray($aForumLink) Then _IEAction($aForumLink[0],"click")

Of course, the call is only really needed for nested, or difficult to grab objects.

Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...