From dave at obtiva.com Tue Sep 4 08:35:11 2007 From: dave at obtiva.com (Dave Hoover) Date: Tue, 4 Sep 2007 07:35:11 -0500 Subject: [SafariWatir-general] Selecting from popup menus doesn't trigger Javascript In-Reply-To: References: Message-ID: <11c8704e0709040535v74b549faq21aa6e293974fd79@mail.gmail.com> Andre, this is a question for the main Watir list, which is focused on IE. This list is specifically for the Watir implementation for the Safari browser. You can probably find the answer to your question by starting here: http://wtr.rubyforge.org/community.html On 8/31/07, Andre Padilla wrote: > > > > 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 > _______________________________________________ > SafariWatir-general mailing list > SafariWatir-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/safariwatir-general >