PaulIlavarasu Posted August 25, 2016 Posted August 25, 2016 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
argumentum Posted August 25, 2016 Posted August 25, 2016 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now