P
Phil Mcdonnell
I'm trying to use Watir to log into a page. I can't seem to find the
login button in order to click on it. From the Watir examples I've read
it seems I need the following code:
browser = Watir::Safari.new
browser.goto @login_page
browser.text_fieldname, 'UserID').set(ARGV[0])
browser.text_fieldname, 'Password').set(ARGV[1])
browser.buttonalt, 'Login').click
However, the final line doesn't do anything. Note, the text_field lines
do correctly set the username and password. Any idea how to fix this?
Here's the relavent html:
<FORM NAME="frmLogon"
ACTION="/myca/logon/us/action?request_type=LogLogonHandler&location=us_logon1"
METHOD="POST" onkeypress="formSub(event)">
... lots of stuff ...
<input type='image' src ="/myca/logon/us/shared/images/btn_login.gif"
alt="Login" style="margin-top:5;margin-left:20;margin-bottom:22" border
= "0" tabIndex='5' onClick="javascript:loginNow();return false;">
... lots of stuff ...
</FORM>
Also, the full site is here:
https://online.americanexpress.com/...ountSummary&us_nu=logincontrol&Info=CUExpired
login button in order to click on it. From the Watir examples I've read
it seems I need the following code:
browser = Watir::Safari.new
browser.goto @login_page
browser.text_fieldname, 'UserID').set(ARGV[0])
browser.text_fieldname, 'Password').set(ARGV[1])
browser.buttonalt, 'Login').click
However, the final line doesn't do anything. Note, the text_field lines
do correctly set the username and password. Any idea how to fix this?
Here's the relavent html:
<FORM NAME="frmLogon"
ACTION="/myca/logon/us/action?request_type=LogLogonHandler&location=us_logon1"
METHOD="POST" onkeypress="formSub(event)">
... lots of stuff ...
<input type='image' src ="/myca/logon/us/shared/images/btn_login.gif"
alt="Login" style="margin-top:5;margin-left:20;margin-bottom:22" border
= "0" tabIndex='5' onClick="javascript:loginNow();return false;">
... lots of stuff ...
</FORM>
Also, the full site is here:
https://online.americanexpress.com/...ountSummary&us_nu=logincontrol&Info=CUExpired