Sign in to follow this  
Followers 0
anyday

_ieclicklinkbytext

7 posts in this topic

Im doing a _IEClickLinkByText($oIE, "Install this cert", "", 0) on a website. when it gets to the function the script pauses on this line in ie.au3

$result = $link.click

and it just locks up the script. if i look at the debug in tray it says

(Paused) ie.au3

Line 543: $result = $link.click

what happens when it clicks on the link it pops up a IE warning box saying Potential Scripting Violation thats why i added the 0 to the command so that the script would pick up on the pop up box and click yes to it.

did i type the command in wrong? i assumed that if i set _IEClickLinkByText("","","", 0 ) it would not do the _IELoadWait() function?

sorry for all the questions, but im learning :think:

Share this post


Link to post
Share on other sites



It does do _IELoadWait() unless you write the command like this:

_IEClickLinkByText($o_object, $s_linkText, 0, 0)

Share this post


Link to post
Share on other sites

ok i fixed that.

but the strangest thing is happening.

Here is the code

$oForm = _IEFormGetObjByName($oIE, "UIForm")
    $oRadio = _IEFormElementGetObjByName($oForm, "rbKeyUsage")
    $oKey = _IEFormElementGetObjByName($oForm, "tbKeySize")
    $oSubmit = _IEFormElementGetObjByName($oForm, "btnSubmit")
    $oRadio.click
    Sleep (200)
    _IEFormElementSetValue($oKey, "1024")
    $oSubmit.click
    Sleep (300)
    If WinExists("Potential Scripting Violation", "") Then
        WinActivate("Potential Scripting Violation", "")
        ControlClick("Potential Scripting Violation", "", "Button1")
    EndIf
    Sleep (4000)
    _IEClickLinkByText($oIE, "Install this certificate", 0, 0)
    Sleep (300)
    Send ("{!y}")
Sleep (3000)

it does the _IEClickLinkByText but after it does that i look at the debug in the icon tray and it says its on line 74 which is the Sleep (4000) , how is it doing the _IEClickLinkByText and then going a line back? or am i just crazy :think:

Share this post


Link to post
Share on other sites

Can someone help with this code. it works fine all the way up to

_IEClickLinkByText($oIE, "Install this certificate", 0, 0)
the script will click on the link just fine but after it clicks on the link the script just sits there and when i look at tray debug it says its on Sleep(2000) right before the clicklinkbytext.

WinWaitActive( "Connect to enroll", "" )
    WinActivate( "Connect to enroll", "" )
    ControlSetText( "Connect to enroll", "", "Edit2", $FFLOGIN )
    Sleep (500)
    ControlSetText( "Connect to enroll", "", "Edit3", $FFPASS )
    Sleep (500)
    ControlClick ( "Connect to enroll", "", "Button2" )
    _IELoadWait($oIE)
    _IENavigate($oIE, "https://www.website.com")
    $oForm = _IEFormGetObjByName($oIE, "UIForm")
    $oRadio = _IEFormElementGetObjByName($oForm, "rbKeyUsage")
    $oKey = _IEFormElementGetObjByName($oForm, "tbKeySize")
    $oSubmit = _IEFormElementGetObjByName($oForm, "btnSubmit")
    $oRadio.click
    Sleep (200)
    _IEFormElementSetValue($oKey, "1024")
    $oSubmit.click
    Sleep (300)
    _Script()
    Sleep ( 2000 )
    _IEClickLinkByText($oIE, "Install this certificate", 0 , 0)
    Sleep (200)
    $var = _IEGetProperty($oIE, "readystate")
    MsgBox (0, "ReadyState", $var, 20)
    _Script()
    Sleep (3000)

Share this post


Link to post
Share on other sites

i remember someone using

Send("{TAB}")

Send("{ENTER}")

on a pop-up box... maybe try that

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

yea it works that way but im trying to make it work with the window hidden

Share this post


Link to post
Share on other sites

yea it works that way but im trying to make it work with the window hidden

There could be a javascript onclick event associated with that link. Depending on what it does, it can cause the script stall until it returns. You'll need to study the logic. There would be away to give focus to the link and then send a space to activate it but you should study what is happing on the page to see if it would be fruitful before we go there.

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0