From apadilla at catalystsecure.com Fri Aug 31 14:22:58 2007 From: apadilla at catalystsecure.com (Andre Padilla) Date: Fri, 31 Aug 2007 12:22:58 -0600 Subject: [SafariWatir-general] Selecting from popup menus doesn't trigger Javascript Message-ID: Hi Dave, Not sure if you can help me out here or if you are even taking any more emails from frustrated watir scripters. I am fairly new to programming so forgive my ignorance in this. I found a possible solution on http://www.hanselman.com/blog/ClickingAJavaScriptDialogUsingWatir.aspx but it does not work. I get a window that seems to be searching for the popup window name but it apparently does not like what it sees and goes away and the popup is still there. The popup occurs when I click on a "Copy" button that will copy selected documents to a specified folder. I thought that the popup window name should be identified somehow but in this solution it is not. Attempted solution 1: def startClicker(button , waitTime = 3) w = WinClicker.new longName = $ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end $ie.link(:text,"Copy to Folder").click $ie=Watir::IE.attach(:title,/Copy Page/) $ie.span(:index,12).click startClicker("OK" , 3) $ie.button(:value,"Copy").click Attempted solution 2: require 'JavascriptHelper.rb' include JavaScriptDialog $ie.link(:text,"Copy to Folder").click $ie.span(:index,12).click $ie=Watir::IE.attach(:title,/Copy Page/) JavascriptHelper.check_dialog(OK){ $ie.button(:value,"Copy").click } Any help you can provide would be greatly appreciated. Regards, Andre Padilla QA Software Mgr/Tech Lead Catalyst Repository Systems, Inc. 1860 Blake Street, Suite 700 Denver, CO 80202 tel: 303-824-0860 (o) fax: 303-293-9073 (c) mailto:apadilla at catalystsecure.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/safariwatir-general/attachments/20070831/618ed635/attachment.html