DavidTunnell Posted September 10, 2013 Posted September 10, 2013 I am trying to move my mouse to a location independent of screen resolution. The reason is this is a dropdown menu and because the site is largly coded in php there is no link to get to backups that i can reference directly. The problem is that it doesn't have an id: <li class="l1"><a>Protect</a><ul class="l2"><li class="l2 navLinks " page="backups"><a>Backups</a></li></ul></li> I tried the following: $ProtectObject = _IEGetObjById($IEObject, "Protect") $ProtectXCoord = _IEPropertyGet($IEObject, "screenX") $ProtectYCoord = _IEPropertyGet($IEObject, "screenY") MouseMove($ProtectXCoord,$ProtectYCoord) But it is not finding it. How do I go about this?
Valuater Posted September 10, 2013 Posted September 10, 2013 Local $oForm = _IEFormGetObjByName($IEObject, "f") ; form name Local $oQuery = _IEFormElementGetObjByName($oForm, "Protect") _IEFormElementSetValue($oQuery, "Protect") it should look more like this... NOT TESTED I would not use Mousemove() in this type of situation. 8)
DavidTunnell Posted September 10, 2013 Author Posted September 10, 2013 On 9/10/2013 at 8:26 PM, Valuater said: Local $oForm = _IEFormGetObjByName($IEObject, "f") ; form name Local $oQuery = _IEFormElementGetObjByName($oForm, "Protect") _IEFormElementSetValue($oQuery, "Protect") it should look more like this... NOT TESTED I would not use Mousemove() in this type of situation. 8) The text is not within a form.
Solution dragan Posted September 10, 2013 Solution Posted September 10, 2013 (edited) how about this: $allAelements = _IETagNameGetCollection($IEObject, "a") if IsObj($allAelements) Then For $oneAelement in $allAelements If $oneAelement.innertext == "Protect" Then _IEAction($oneAelement, "Focus") _IEAction($oneAelement, "Click") ExitLoop EndIf Next EndIf Edited September 10, 2013 by dragan DavidTunnell 1
DavidTunnell Posted September 10, 2013 Author Posted September 10, 2013 (edited) On 9/10/2013 at 8:42 PM, dragan said: how about this: $allAelements = _IETagNameGetCollection($IEObject, "a") if IsObj($allAelements) Then For $oneAelement in $allAelements If $oneAelement.innertext == "Protect" Then _IEAction($oneAelement, "Focus") _IEAction($oneAelement, "Click") ExitLoop EndIf Next EndIf Very interesting Prodigy. However text 'Protect' is not actually what's being clicked. Once the mouse moves over this location it shows 'Backup' this is what needs to be clicked. Additionally, the link is not in the page source. I believe it is being rendered with AJAX. Is it possible to get the mouse coordinates of the string 'Protect'? Edited September 10, 2013 by DavidTunnell
DavidTunnell Posted September 10, 2013 Author Posted September 10, 2013 (edited) On 9/10/2013 at 8:48 PM, Valuater said: LOOSE THE MOUSEMOVE() 8) I would like to but I don't see an alternative since there is no link in the source and you can't access the 'Backup' without a mouseover. I am open to additional ideas but this works: $allAelements = _IETagNameGetCollection($IEObject, "a") if IsObj($allAelements) Then For $oneAelement in $allAelements If $oneAelement.innertext == "Protect" Then $ProtectXCoord = _IEPropertyGet($oneAelement, "screenX") $ProtectYCoord = _IEPropertyGet($oneAelement, "screenY") ExitLoop EndIf Next EndIf MouseMove($ProtectXCoord,$ProtectYCoord) Thanks Prodigy! Edited September 10, 2013 by DavidTunnell
dragan Posted September 10, 2013 Posted September 10, 2013 the "Backup" doesn't pop up after "Focus" and "Click" IE Actions? If so, would this help?: $allAelements = _IETagNameGetCollection($IEObject, "a") if IsObj($allAelements) Then For $oneAelement in $allAelements If $oneAelement.innertext = "Protected" Then $oneAelement.fireEvent("onmouseover") ;... if "Backup" popped up search for "Backup" element ;the same way and simulate "focus"+"click" on it here: ;... ExitLoop EndIf Next EndIf
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