Jump to content

Autoit script stalls on Windows Internet Explorer Window -


Recommended Posts

Hi,

I have a bit of an issue with the Autoit script refusing to detect the "Internet Explorer Window" and click OK button on it. (to confirm the deletion). Pressing OK manualy works fine, and script carrys on... I have tried a few possible solutions like WinWaitActive "title", WinActivate etc...

Code:

_IENavigate ($oIE, "http://192.168.52.33/somesite/")

_IELoadWait ($oIE)

_IEImgClick ($oIE, "images/controls/deleteenabled.gif", "src", 0)

$Win= _IELoadWait ($oIE)

Source:

<A language=javascript onclick="return StandardOfPracticeDeletion_onclick(this, '{8B3E8D39-9659-4814-8C8B-E1C0A7396CC1}', 'SOP.U.3', 'CDC general IT standard of practice and checklist with recommended tests etc (BS7799 \x2702 edition)', 1);" tabIndex=-1 href="java script:StandardOfPracticeDeletion_submit();" target=_self><IMG height=16 alt="Delete standard of practice" src="images/controls/deleteenabled.gif" width=16 border=0>

Clicking on it will bring "Windows Internet Explorer" windows asking to confirm the deletion. I have searched through the forum and found some mentioning of Java alert and its related weirednes. Any suggestions are very appriciated.

Thanks.

Link to comment
Share on other sites

See Example 2 for _IEAction

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

See Example 2 for _IEAction

Dale

Thanks for a quick reply Dale. Have tried this, the trick is: There is a checkbox, that needs to be checked, and then "refresh" button clicked on (cmdRefresh). the code is down below (I`ve commented out the lines that I had and inserted ones from the Example, script just waits there after "focusing" on the check box... which I think is fine)

$oIE = _IECreate ("http://192.168.52.33/")

_IELoadWait ($oIE)

;;_IENavigate ($oIE, "http://192.168.52.33/")

;$oSubmit = _IEGetObjByName ($oIE, "chkSpecifiableDelete", "DeleteColumn")

; _IEAction ($oSubmit, "click");;

;MsgBox(4096, "Delete", "On the next window, please cleck Delete manualy.")

$oSubmit = _IEGetObjByName ($oIE, "chkSpecifiableDelete", "DeleteColumn")

$hwnd = _IEPropertyGet($oIE, "hwnd")

_IEAction ($oSubmit, "focus")

_IEAction ($oSubmit, "click")

$oSubmit = _IEGetObjByName ($oIE, "cmdRefresh")

_IEAction ($oSubmit, "click")

_IELoadWait ($oIE)

ControlSend($hwnd, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")

; Wait for Alert window, then click on OK

WinWait("Windows Internet Explorer", "ExampleFormSubmitted")

ControlClick("Windows Internet Explorer", "ExampleFormSubmitted", "[CLASS:Button; TEXT:OK; Instance:1;]")

_IELoadWait ($oIE)

The Windows Internet Explorer pops up asking to confirm the deletion - but nothing happens...

Thank you for your help.

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...