Unable to handle a browser window

P

Pranjal Jain

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top