Unable to handle a browser window

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[b].to_s)
$ie.text_field(:name,’{actionForm.password}’).set($password[b].to_s)
$ie.button(:name, ‘actionOverride:validateLogin.do’).click

if($ie.link(:href,“javascript:openWin(‘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:openWin(‘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 :slight_smile:
Thanks in advance

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs