Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Unable to handle a browser window

Reply
Thread Tools

Unable to handle a browser window

 
 
Pranjal Jain
Guest
Posts: n/a
 
      05-06-2008
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,"javascriptpenWin('callComment Action.do?projectID=39049&posreqID=3&projectName=T esting
Practice&displayDate=Mon, 05-May-08 - Sun, 11-May-08( Week Number 19
)&userName=Pranjal.Jain&index=0&comments=','winAme nd',500,250)").exists?)
begin
$ie.link(:href,"javascriptpenWin('callCommentAct ion.do?projectID=39049&posreqID=3&projectName=Test ing
Practice&displayDate=Mon, 05-May-08 - Sun, 11-May-08( Week Number 19
)&userName=abc.xyz&index=0&comments=','winAmend',5 00,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...tAction_1_.txt

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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to handle web requests without an ASPX page? i.e. have DLL handle request. jdlwright@shaw.ca ASP .Net 2 05-31-2005 05:42 PM
Open new window in codebehind and add the window handle to javascript array RJN ASP .Net 1 10-10-2004 07:53 PM
Get window handle by window name RJN ASP .Net 0 10-10-2004 02:00 PM
make a browser window stay on top window handle? =?Utf-8?B?RHVzdGluIElJLg==?= ASP .Net 1 08-18-2004 06:26 AM
File Handle Reading Blues: Rereading a File Handle for Input Dietrich Perl 1 07-22-2004 10:02 AM



Advertisments