# Watir: Clicking on a Window pop-up

**URL:** <https://www.ruby-forum.com/t/watir-clicking-on-a-window-pop-up/139388>\
**Category:** Ruby\
**Created:** [June 3, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/watir-clicking-on-a-window-pop-up/139388 "2008-06-03T14:06:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anukulsinghal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/dbc845/32.png) [@anukulsinghal](https://www.ruby-forum.com/u/anukulsinghal)\
**Post date:** [June 3, 2008, 2:06pm UTC](https://www.ruby-forum.com/t/watir-clicking-on-a-window-pop-up/139388/1 "2008-06-03T14:06:00Z")

</div>

Hi,

I am working on an app which requires me to fill in the login  
credentials and then click on the Windows pop-up. The Window pop-up has  
windowCaption = “Microsoft Internet Explorer”, buttonCaption = “OK”

require ‘watir’  
require ‘watir/winClicker’

ie = Watir::IE.new  
ie.goto(“[www.abc.com](http://www.abc.com)”)  
ie.text\_field(:name, “USER”).set “michael”  
ie.text\_field(:name, “PASSWORD”).set “schumi”  
ie.image(:src, “[http://submit.gif](http://submit.gif)”).click  
wc = WinClicker.new  
wc.clickWindowsButton(“Microsoft Internet Explorer”, “OK”, 30)

But it does not click on the pop-up. I even tried the method  
clickJavaScriptDialog(button = “OK”, parenthWnd = -1), but to no luck.  
Even tried to change the window caption from “Microsoft Internet  
Explorer” to “Internet Explorer”, but still no luck.

Ultimately, to stop the execution, I click on the pop-up manually and  
then it gives the error as  
"c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/watir/winClicker.rb:232:  
[BUG] Segementation Fault

This application has requested runtime to terminate it in an unusual  
way. Please contact the application’s support team for more  
information."

Can anyone help in getting the solution for clicking the Windows Pop-up  
with windowCaption as “Microsoft Internet Explorer” and Button caption  
as “OK”?

Thanks,  
Anukul
