Jump to content

How to click on Megamenu Button to drop down .in mozilla


Recommended Posts

clickThis()
Func clickThis()
    Local $aWinPos = WinGetPos("[CLASS:MozillaWindowClass]")
;~ Success: a 4-element array containing the following information:
;~     $aArray[0] = X position
;~     $aArray[1] = Y position
;~     $aArray[2] = Width
;~     $aArray[3] = Height
;~ Failure: sets the @error flag to non-zero if the window is not found.

    If UBound($aWinPos) < 4 Then Return SetError(1, 0, 0)
    WinActivate("[CLASS:MozillaWindowClass]")
    Local $iMouseCoordMode = Opt("MouseCoordMode", 2) ; 2 = relative coords to the client area of the active window
    Local $iReturn = MouseClick("Main", 41, 113, 1, 10) ; 41 , 133 is, in my case, where I want to click <---- this is waht you need
    Opt("MouseCoordMode", $iMouseCoordMode) ; set it back as it was
    If Not $iReturn Then Return SetError(2, 0, 0) ; the button is not in the list or invalid parameter as x without y.
    Return SetError(0, 0, 1)
EndFunc   ;==>clickThis

so using AutoIt Window Info ( Au3Info.exe ) , find the relative position of the button to the client area ( in my case 41 & 113 ) and that is it.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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

  • Recently Browsing   0 members

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