I am running into a few compounding problems:
All I am trying to do is click a continue button using Internet Explorer.
$oIE = _IEAttach("Sprint")
_IEImgClick($oIE, "Continue", "alt",0,0)
The problem is that the website uses javascript once the continue button is pressed. It then causes AutoIT to be nonresponsive until the javascript prompt is clicked. (Javascript confirm function)
The conventional wisdom seems to be to use example 2 on _IEAction as such:
Local $oIE = _IE_Example("form")
Local $oSubmit = _IEGetObjByName($oIE, "submitExample")
Local $hWnd = _IEPropertyGet($oIE, "hwnd")
_IEAction($oSubmit, "focus")
ControlSend($hWnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
This doesn't work for me either because the javascript is coded in such a way that it only proceeds when clicked by the left mouse button... the enter key seems to refresh the page.
The next thing I tried was to get the coordinates of the Continue button. I get coordinate values back but they don't seem to relate to the button properly.
$oImgs = _IEImgGetCollection($oIE)
For $oImg In $oImgs
If StringInStr($oImg.src,"ContinueYellow",0) Then
$ContinueButtonImage = $oImg
Endif
Next
$ContinueButtonImageXcoordinate = _IEPropertyGet($ContinueButtonImage,"browserx")
$ContinueButtonImageYcoordinate = _IEPropertyGet($ContinueButtonImage,"browsery")
MouseClick("left",$ContinueButtonImageXcoordinate, $ContinueButtonImageYcoordinate)
Can any advise how to resolve this? Example 3 gets the proper image... if I look at $oImg.src it has the proper URL. Also, I was having trouble getting the scrollintoview option to work... whenever I try _IEAction($ContinueButtonImage, "scrollintoview") it does not work.
I would greatly appreciate any help as I've spent about 5 hours trying to make this work.