clicking on popup after selecting an item in select list

Discussion in 'Ruby' started by Vikash Kumar, Dec 20, 2006.

  1. Vikash Kumar

    Vikash Kumar Guest

    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/.
     
    Vikash Kumar, Dec 20, 2006
    #1
    1. Advertising

  2. Vikash Kumar

    Vikash Kumar Guest

    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/.
     
    Vikash Kumar, Dec 20, 2006
    #2
    1. Advertising

  3. Vikash Kumar

    Alex Young Guest

    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
     
    Alex Young, Dec 20, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Criswell
    Replies:
    1
    Views:
    1,394
    John Criswell
    Jul 24, 2003
  2. Bogdan Zamfir

    Selecting an item in a drop down list

    Bogdan Zamfir, Aug 17, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    436
    Bogdan Zamfir
    Aug 17, 2003
  3. Amy Snyder

    Selecting item from popup

    Amy Snyder, Jan 28, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    317
    Michael Ramey
    Jan 28, 2004
  4. Liuc
    Replies:
    4
    Views:
    171
  5. Jens Peter Hansen
    Replies:
    7
    Views:
    566
    Randy Webb
    Jun 19, 2004
Loading...

Share This Page