Jump to content

Problem with _IELinkClickByText and javascript confim box


doccy
 Share

Recommended Posts

Hi there :D

I'm having a little problem with a java confirm box;

When the script recognize the name and press the link a confirmation box pop up (and for now is all ok), but until i manually press the Ok or Cancel button the script wont show the msgbox message.

No matter what i try to do after the _IELinkClickByText line; i can't go past it without pressing Ok or Cancel in the box

Is there a workaround or a solution for this ?

Thanks in advance !

#include <IE.au3>

global $oIE = _IECreate("http://www.crowderassoc.com/javascript/confirm.html",1,1,0)
_IELoadWait ($oIE)
_IELinkClickByText ($oIE, "HOT Web site!",0,0)
msgbox(0,"waiting....","1 2 3 here i'm!")
Link to comment
Share on other sites

Seet the section example for _IEAction in the helpfile.

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

Thanks for the reply Dale, but i already tried with _IEAction without luck

#include <IE.au3>

global $oIE = _IECreate("http://www.crowderassoc.com/javascript/confirm.html",1,1,0)
_IELoadWait ($oIE)

$sMyString = "HOT Web site!"
$oLinks = _IELinkGetCollection($oIE)
For $oLink in $oLinks
    $sLinkText = _IEPropertyGet($oLink, "innerText")
    If StringInStr($sLinkText, $sMyString) Then
        msgbox(0,"before","1 2 3 here i'm!")
        _IEAction($oLink, "click")
        msgbox(0,"after","1 2 3 here i'm!")
        ControlSend(" ", "Go to Crowder", " ", "button1")
        ExitLoop
    EndIf
Next

i get the first msgbox, i get the confirm box, but i don't get the 2nd msgbox... it gets stuck like the _IELinkClickByText :D

i need to press Ok or Cancel manually for let it appear

Link to comment
Share on other sites

Look at the second example again. It does not use _IEAction click

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

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