Problem Description:
- I'm trying to dismiss an AutoComplete _javascript_ popup window on a Login page, but I can't get the script to press the Yes/No button.
Background: Checked FAQ and searched Message Archives - haven't found anything that helps.
ENV'T & SETUP:
- Running Ruby 184-16p3, Watir 1.4.1 on Windows XP
- IE 6.0, go to: Tools > Internet Options > Content > [AutoComplete...] and put checkmarks next to (i) "User names and passwords on forms", and (ii) "Prompt me to save passwords", press [OK] buttons to save the changes
- Go to a Login screen of some sort, enter the User ID and password
=> When the "AutoComplete" dialog appears, press [Yes].
The SCRIPT:
----
require 'watir'
include Watir
require 'test/unit'
class TC_Sign_In < Test::Unit::TestCase
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
def test_Sign_In
# open the web browser and go to the Login page
...
# enter correct Username and *incorrect* Password
$ie.text_field(:name, /UserNameField/).set($userID)
$ie.text_field(:name, /PasswordField/).set($pass + "1")
# expect the AutoComplete dialog to pop up because the password is different
startClicker("No")
$ie.button(:name, /LoginButton/).click
...
end
----
So, what happens?
=> The Login page appears, the username and password are entered as expected, the [Login] button is pressed, the AutoComplete dialog appears as expected.
=> Then .. nothing...
=> It looks like there is a pause and then the (modal) AutoComplete dialog loses focus somehow. The Watir script just hangs at this point.
- If I manually click the [No] button, the script continues to completion without error.
Please help! How can I click this popup to make it go away?
_______________________________________________ Wtr-general mailing list [email protected] http://rubyforge.org/mailman/listinfo/wtr-general
