# How do i select "OK" button on MS Internet Explorer Popup window

**URL:** <https://www.ruby-forum.com/t/how-do-i-select-ok-button-on-ms-internet-explorer-popup-window/159420>\
**Category:** Rails\
**Created:** [February 4, 2009, 12:55pm UTC](https://www.ruby-forum.com/t/how-do-i-select-ok-button-on-ms-internet-explorer-popup-window/159420 "2009-02-04T12:55:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandra\_sekhar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/8c91f0/32.png) [@chandra\_sekhar](https://www.ruby-forum.com/u/chandra_sekhar)\
**Post date:** [February 4, 2009, 12:55pm UTC](https://www.ruby-forum.com/t/how-do-i-select-ok-button-on-ms-internet-explorer-popup-window/159420/1 "2009-02-04T12:55:28Z")

</div>

Hi

I am chandra sekhar, i am new to Ruby…

i got stucked when i am executing one program…i have defined the Pop-Up  
function in one class, and i am calling this Pop-up function at main  
script.

while executing the script, the “winclicker” is not clicking “OK” button  
on  
the popup window.

can anybody help me on this…

```
   def popupHandler(hwnd, popupWinButton)
      popupWindowTitle = "Microsoft Internet Explorer"
      popup = WinClicker.new
      popup.makeWindowActive(hwnd)
      popup.clickWindowsButton(popupWindowTitle, popupWinButton)
      @csvLogger.debug("Popup: " + 

```

popup.getStaticText\_hWnd(hwnd).to\_s +  
": Clicked " + popupWinButton)  
end

```
    def checkForPopup(ie, popupWinButton,waitTime=POPUP_WAIT)
    hwnd = ie.enabled_popup(waitTime)
       if (hwnd)
            popupHandler(hwnd, popupWinButton)
       end
    end
```

---

<div class="post-metadata">

**Author:** ![chandra\_sekhar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/8c91f0/32.png) [@chandra\_sekhar](https://www.ruby-forum.com/u/chandra_sekhar)\
**Post date:** [February 4, 2009, 2:41pm UTC](https://www.ruby-forum.com/t/how-do-i-select-ok-button-on-ms-internet-explorer-popup-window/159420/2 "2009-02-04T14:41:59Z")

</div>

What’s winclicker? You haven’t explained everything you’re using. Ruby/  
rails code is executed server side. A button click is usually client  
side.

Blog: [http://random8.zenunit.com/](http://random8.zenunit.com/)  
Learn rails: [http://sensei.zenunit.com/](http://sensei.zenunit.com/)

On 04/02/2009, at 10:32 PM, chandra sekhar [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
