# Clicking on popup after selecting an item in select list

**URL:** <https://www.ruby-forum.com/t/clicking-on-popup-after-selecting-an-item-in-select-list/79877>\
**Category:** Ruby\
**Created:** [December 20, 2006, 4:53am UTC](https://www.ruby-forum.com/t/clicking-on-popup-after-selecting-an-item-in-select-list/79877 "2006-12-20T04:53:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikashkumar051](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/eb9ed0/32.png) [@vikashkumar051](https://www.ruby-forum.com/u/vikashkumar051)\
**Post date:** [December 20, 2006, 4:53am UTC](https://www.ruby-forum.com/t/clicking-on-popup-after-selecting-an-item-in-select-list/79877/1 "2006-12-20T04:53:24Z")

</div>

I am getting a javascript pop up after I select a value from some drop  
down list using the select\_list method. Since I can not use  
click\_no\_wait for a list, how am I supposed to handle the pop up.

Can anyone please provide a solution for it.

I am using the following code to assess a select list, I am using Watir  
Version 1.5.1.1100

The code is as follows :

require ‘watir’ # the watir controller  
require ‘watir/winClicker.rb’  
require ‘watir\contrib\enabled\_popup’  
require ‘Enter\_on\_inputbox’

enter\_on\_inputboxObj = Enter\_on\_inputbox.new

instance = “c:\aa.htm”  
ie=Watir::IE.start(instance)

#THIS PART IS WORKING, using click\_no\_wait  
ie.image(:index,‘4’).click\_no\_wait  
enter\_on\_inputboxObj.startClicker(ie, $hwnd, “OK”, 7, “Good”)  
###############################

ie.select\_list(:name, “trx”).select(“First”)

# Here too a javascript box is coming, but I am unable to click on the

OK button

I have defined a class name Enter\_on\_inputbox

require ‘watir/winClicker.rb’  
class Enter\_on\_inputbox  
def initialize  
end

```
def startClicker( ie, hwnd, button , waitTime, user_input)
    hwnd = ie.enabled_popup(waitTime) # get a handle if one exists
        w = WinClicker.new
    if (hwnd) # yes there is a popup
        w = WinClicker.new
             if ( user_input )
                 print(user_input)
                 $stdout.flush
            w.setTextValueForFileNameField(hwnd, "#{user_input}")

             end
            sleep 3 # I put this in to see the text being input it

```

is not necessary to work

```
        w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or

```

whatever the name on the button is  
w=nil # this is just cleanup  
end  
end  
end

After it select the value from list, a javascript pop up comes asking  
for OK or Cancel, here my code get stops until I click manually on OK or  
Cancel Button, please help me out from this.

Thanks in advance  
Vikash

---

<div class="post-metadata">

**Author:** ![vikashkumar051](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/eb9ed0/32.png) [@vikashkumar051](https://www.ruby-forum.com/u/vikashkumar051)\
**Post date:** [December 20, 2006, 6:52am UTC](https://www.ruby-forum.com/t/clicking-on-popup-after-selecting-an-item-in-select-list/79877/2 "2006-12-20T06:52:07Z")

</div>

Vikash Kumar wrote:

> I am getting a javascript pop up after I select a value from some drop  
> down list using the select\_list method. Since I can not use  
> click\_no\_wait for a list, how am I supposed to handle the pop up.
> 
> Can anyone please provide a solution for it.

> Thanks in advance  
> Vikash

I am using a test case in ruby, watir and a html page, but I am stuck  
when I select values from select list, as javascript popup comes up.  
Please provide a solution for this. Any help will be appreciated.

---

<div class="post-metadata">

**Author:** ![vikashkumar051](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/eb9ed0/32.png) [@vikashkumar051](https://www.ruby-forum.com/u/vikashkumar051)\
**Post date:** [December 20, 2006, 7:24pm UTC](https://www.ruby-forum.com/t/clicking-on-popup-after-selecting-an-item-in-select-list/79877/3 "2006-12-20T19:24:55Z")

</div>

Vikash Kumar wrote:

> I am using a test case in ruby, watir and a html page, but I am stuck  
> when I select values from select list, as javascript popup comes up.  
> Please provide a solution for this. Any help will be appreciated.  
> You may wish to ask on the watir list. Alternatively,  
> [watir javascript popup - Google Search](http://www.google.co.uk/search?q=watir+javascript+popup) will probably  
> give you what you want.
