Jump to content

IE event, then click on messagebox


DaLiMan
 Share

Recommended Posts

Hi,

 

I'm trying to click the close button in a website at work.
To click the button is not a problem, but then a message comes up to ask [are you sure?]

I have to click [OK] but the script keeps waiting for the explorer window.
So when i manually click the [OK] button, the script continues.

Is there any way to not pause the script and hit the [OK] button automatically?

PS: When I start a script with the last 3 lines when the messagebox pops up, it works just fine.

 

Attempt 1

Func _Sluiten_btn()
    ;---------------------------------------------------------------------
    ;Klik op de knop  [Nieuw 6.2.1 Accordeer personen]
    ;---------------------------------------------------------------------
    Local $oSearch = _IEGetObjById($oIE, 'close_label')
    _IEAction($oSearch, "click")
    ;---------------------------------------------------------------------
EndFunc   ;==>_Sluiten_btn

Attempt 2

Func _Sluiten_btn()
    ;---------------------------------------------------------------------
    ;Klik op de knop  [Nieuw 6.2.1 Accordeer personen]
    ;---------------------------------------------------------------------
    Local $oSearch = _IEGetObjById($oIE, 'close_outer')
    $oSearch.FireEvent("onclick")
    ;---------------------------------------------------------------------
EndFunc   ;==>_Sluiten_btn

 

Works fine to hit OK, but only in a seperate script?!

WinWait("[CLASS:#32770]")
    WinActivate("[CLASS:#32770]")
    ControlClick("[CLASS:#32770]", "","[CLASS:Button; INSTANCE:1]")

 

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