D
David Nightingale
Hello,
I am new at this and using a co-worker app to record test scripts in
Ruby. Its called Watir. The script I have logs into a test account for
online banking. It then hits the logoff URL which sends you to a page
with a "Close Window" or "Login" button. The close button does this:
javascript:doClose()
Everything works great except the close window part. When you click the
close button a Window IE Popup comes up saying a program is attempting
to close the window. Do you want to close it? Yes or No.
How in the heck to I go about closing this window with the script. Here
is what I have, though keep i mind I have ommitted the account
information.
require 'watir'
include Watir
require 'test/unit'
class TC_recorded < Test::Unit::TestCase
def test_recorded
ie = IE.new
ie.goto('http://www.capitalonebank.com/')
ie.text_fieldname, 'txtUserID').set('user id here')
ie.text_fieldname, 'txtPassword').set('password here')
ie.buttonname, 'login').click
ie.text_fieldid, 'txtSecurityAnswer1').set('answer here')
ie.buttonid, 'btnLogIn').click
ie.goto('https://onlinebanking.capitalone.com/CAPITALONE/Logout.aspx')
ie.goto('javascript:top.window.close()')
end
end
This is driving me crazy so any help would be great! Even if I could
somehow click the X in the right corner with code, that would be a way
to avoid the question in the first place! But I dont know how.
David
I am new at this and using a co-worker app to record test scripts in
Ruby. Its called Watir. The script I have logs into a test account for
online banking. It then hits the logoff URL which sends you to a page
with a "Close Window" or "Login" button. The close button does this:
javascript:doClose()
Everything works great except the close window part. When you click the
close button a Window IE Popup comes up saying a program is attempting
to close the window. Do you want to close it? Yes or No.
How in the heck to I go about closing this window with the script. Here
is what I have, though keep i mind I have ommitted the account
information.
require 'watir'
include Watir
require 'test/unit'
class TC_recorded < Test::Unit::TestCase
def test_recorded
ie = IE.new
ie.goto('http://www.capitalonebank.com/')
ie.text_fieldname, 'txtUserID').set('user id here')
ie.text_fieldname, 'txtPassword').set('password here')
ie.buttonname, 'login').click
ie.text_fieldid, 'txtSecurityAnswer1').set('answer here')
ie.buttonid, 'btnLogIn').click
ie.goto('https://onlinebanking.capitalone.com/CAPITALONE/Logout.aspx')
ie.goto('javascript:top.window.close()')
end
end
This is driving me crazy so any help would be great! Even if I could
somehow click the X in the right corner with code, that would be a way
to avoid the question in the first place! But I dont know how.
David