Unable to handle a browser window

Discussion in 'Ruby' started by Pranjal Jain, May 6, 2008.

  1. Pranjal Jain

    Pranjal Jain Guest

    Hi
    In one web site when i am clicking on the page, a new browser window
    is opening. But I cannot handle the window (i.e) I cannot the perform
    the operations like writing the data in it; clicking on the "Save
    Comments" button & closing the window.

    I had written the code also:

    require 'rubygems'
    require 'watir/watir_simple.rb'
    require 'test/unit'
    require 'watir'
    include Watir

    require 'database'
    # User defined library
    require 'popup'
    database()
    b = 0
    $ie = IE.new
    $ie.goto("https://tms.corp.xyz.com/")
    $ie.bring_to_front
    $ie.maximize
    $ie.text_field:)name,'{actionForm.username}').set($username.to_s)
    $ie.text_field:)name,'{actionForm.password}').set($password.to_s)
    $ie.button:)name, 'actionOverride:validateLogin.do').click

    if($ie.link:)href,"javascript:eek:penWin('callCommentAction.do?projectID=39049&posreqID=3&projectName=Testing
    Practice&displayDate=Mon, 05-May-08 - Sun, 11-May-08( Week Number 19
    )&userName=Pranjal.Jain&index=0&comments=','winAmend',500,250)").exists?)
    begin
    $ie.link:)href,"javascript:eek:penWin('callCommentAction.do?projectID=39049&posreqID=3&projectName=Testing
    Practice&displayDate=Mon, 05-May-08 - Sun, 11-May-08( Week Number 19
    )&userName=abc.xyz&index=0&comments=','winAmend',500,250)").click

    startClicker( "Save Comments", 15 , "Hello") # function from popup
    script is cld
    end
    else
    puts "Sorry"
    end
    "

    Here "startClicker" is the standard pop up handler function

    Please suggest :)
    Thanks in advance

    Attachments:
    http://www.ruby-forum.com/attachment/1858/callCommentAction_1_.txt

    --
    Posted via http://www.ruby-forum.com/.
     
    Pranjal Jain, May 6, 2008
    #1
    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. Dietrich
    Replies:
    1
    Views:
    656
    Joe Smith
    Jul 22, 2004
  2. =?Utf-8?B?RHVzdGluIElJLg==?=

    make a browser window stay on top window handle?

    =?Utf-8?B?RHVzdGluIElJLg==?=, Aug 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    882
    Mark Rae
    Aug 18, 2004
  3. RJN
    Replies:
    1
    Views:
    8,759
    Patrik Löwendahl [C# MVP]
    Oct 10, 2004
  4. RJN
    Replies:
    0
    Views:
    4,152
  5. Leon
    Replies:
    2
    Views:
    542
Loading...

Share This Page