PaulIlavarasu

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

2 posts in this topic

i am using an application where it has a megamenu,if i click in that menu then it will open a dropdown or navigation bar ,how can i write a scripts for that 

Megamenu.jpg

Share this post


Link to post
Share on other sites



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.

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