Jump to content

help with pop up handling


Recommended Posts

>>>> Window <<<<

Title: Windows Internet Explorer

Class: #32770

>>>> Control <<<<

Class: Button

Instance: 1

ClassnameNN: Button1

Advanced (Class): [CLASS:Button; INSTANCE:1]

ID: 2

Text: OK

$nip = "10.100.47.100"
$ia = _IETagNameGetCollection($oIE, "INPUT")
for $i in $ia
    If ($i.name) = "OidTN3.6.10" Then
        _IEFormElementSetValue($i, $nip)     -->>How to set $f_wait here so as not to wait for page to load
        ConsoleWrite("Completed: Network IP setting successfully" & @LF)
        ExitLoop
    EndIf
Next
;Sleep(2000)
$avWinList = WinList("[CLASS:#32770]")
ConsoleWrite("Found " & $avWinList[0][0] & " matching windows:" & @LF)
For $n = 1 To $avWinList[0][0]
ConsoleWrite($n & ": " & $avWinList[$n][0] & @LF)
    If String($avWinList[$n][0]) = "Windows Internet Explorer" Then
    ControlClick("Windows Internet Explorer", "", "[CLASS:Button; INSTANCE:1]")
    EndIf
Next

how do I handle the case above as in the case below

_IELinkClickByText($oIE, "settings", 0, 0); Don't wait for page to load after click

_IEFormElementSetValue($i, $nip)---> basically, be able to set $f_wait option

Edited by diikee
Link to comment
Share on other sites

>>>> Window <<<<

Title: Windows Internet Explorer

Class: #32770

>>>> Control <<<<

Class: Button

Instance: 1

ClassnameNN: Button1

Advanced (Class): [CLASS:Button; INSTANCE:1]

ID: 2

Text: OK

$nip = "10.100.47.100"
$ia = _IETagNameGetCollection($oIE, "INPUT")
for $i in $ia
    If ($i.name) = "OidTN3.6.10" Then
        _IEFormElementSetValue($i, $nip)     -->>How to set $f_wait here so as not to wait for page to load
        ConsoleWrite("Completed: Network IP setting successfully" & @LF)
        ExitLoop
    EndIf
Next
;Sleep(2000)
$avWinList = WinList("[CLASS:#32770]")
ConsoleWrite("Found " & $avWinList[0][0] & " matching windows:" & @LF)
For $n = 1 To $avWinList[0][0]
ConsoleWrite($n & ": " & $avWinList[$n][0] & @LF)
    If String($avWinList[$n][0]) = "Windows Internet Explorer" Then
    ControlClick("Windows Internet Explorer", "", "[CLASS:Button; INSTANCE:1]")
    EndIf
Next

how do I handle the case above as in the case below

_IELinkClickByText($oIE, "settings", 0, 0); Don't wait for page to load after click

_IEFormElementSetValue($i, $nip)---> basically, be able to set $f_wait option

You could read the help file under _IEFormElementSetValue():

Parameters

$o_object Object variable of an InternetExplorer.Application, Form Element object

$s_newvalue The new value to be set into the Form Element

$f_fireEvent Optional: specifies whether to fire an onchange event after changing value

0 = Do not fire onchange or onclick event after setting value

1 = (Default) fire onchange and onclick event after setting value

:)
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I read the options already but

_ieformelementsetvalue($i, $nip, 0) will not fire the the onchange() call. that means I don't get the popup alert window which I would like to get so that I can click on the OK button (instance:1)

_ieformelementsetvalue($i, $nip, 1) fires the onchange() call, but it's too fast or too slow because the page load is blocking the popup to be detectect.

$f_wait --->>give you the option not to wait for page load. Is the something like $f_wait for _ieformelementsetvalue

Edited by diikee
Link to comment
Share on other sites

I read the options already but

_ieformelementsetvalue($i, $nip, 0) will not fire the the onchange() call. that means I don't get the popup alert window which I would like to get so that I can click on the OK button (instance:1)

_ieformelementsetvalue($i, $nip, 1) fires the onchange() call, but it's too fast or too slow because the page load is blocking the popup to be detectect.

$f_wait --->>give you the option not to wait for page load. Is the something like $f_wait for _ieformelementsetvalue

Hmm... I see what you mean. Does this work for not waiting?
$hIE = _IEPropertyGet($oIE, "hwnd")

$ia = _IETagNameGetCollection($oIE, "INPUT")
for $i in $ia
    If ($i.name) = "OidTN3.6.10" Then
        _IEFormElementSetValue($i, $nip, 0); How to set $f_wait here so as not to wait for page to load
        _IEAction($i, "focus")
        ControlSend($hIE, "", "[CLASS:Internet Explorer_Server; INSTANCE:1]", "{Enter}")
        ConsoleWrite("Completed: Network IP setting successfully" & @LF)
        ExitLoop
    EndIf
Next

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Nope,

the popup just sits there waiting for the "Ok" button to be clicked

Well, the only thing my code was meant to address was the waiting.

Did the console write of "Completed: Network IP setting successfully" happen before the page was completed or the popup was cleared?

That's all I was shooting for, you seemed to be saying that the script was blocked while the popup was there, this was meant to avoid that.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...