[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Unable to handle a browser window

Pranjal Jain

5/6/2008 9:37:00 AM

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....)
$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 :)
Thanks in advance

Attachments:
http://www.ruby-...attachment/1858/callCommentAct...

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