If you are using the example below as is then you'll need to be
consistent with your ie declaration.  In the startClicker method you use
$ie and in the code below (where you click the submit button) that you
use ie without the $.  However you begin ie = IE.new() OR $ie = IE.new()
you will need to be consistent throughout.

Hope this helps,

--Mark
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hue Mach Dieu
Sent: Monday, July 25, 2005 6:07 PM
To: [email protected]
Subject: [Wtr-general] RE: Click OK button on Popup Dialog?

Hi
I define click popup method like this:

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 ==
__FILE__
require 'watir'
require 'watir/WinClicker'
include Watir

def startClicker( button , waitTime = 0.5)
        w = WinClicker.new
        longName = $ie.dir.gsub("/" , "\\" )
        shortName = w.getShortFileName(longName)
        c = "start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button
} #{waitTime} "
        puts "Starting #{c}"
        w.winsystem(c )   
        w=nil
end

#Then I call it...

startClicker ("OK", 3)

#Then I click the button that produces the popup.

ie.frame("rightframe").frame("search").button(:name, "Submit").click

but I get the error like this

../Util/clickPopup.rb:8:in `startClicker': undefined method `dir' for
nil:NilClass (NoMethodError)
       
Thank for help


_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to