Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > clicking on popup after selecting an item in select list

Reply
Thread Tools

clicking on popup after selecting an item in select list

 
 
Vikash Kumar
Guest
Posts: n/a
 
      12-20-2006
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

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Vikash Kumar
Guest
Posts: n/a
 
      12-20-2006
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.


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Alex Young
Guest
Posts: n/a
 
      12-20-2006
Vikash Kumar wrote:
> 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.

You may wish to ask on the watir list. Alternatively,
http://www.google.co.uk/search?q=watir+javascript+popup will probably
give you what you want.

--
Alex

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
Selecting item from popup Amy Snyder ASP .Net 1 01-28-2004 09:30 PM
Selecting row in datagrid by clicking everyway on the item Liuc ASP .Net Datagrid Control 4 11-14-2003 08:11 AM
Selecting an item in a drop down list Bogdan Zamfir ASP .Net 2 08-17-2003 10:06 PM
Programmatically Selecting Item in Radio Button List John Criswell ASP .Net 1 07-24-2003 07:07 PM



Advertisments