Hello All,
I am trying to automate Fotolog's login page. Please could you help
me.
Following is the snippet of HTML code:
-------------------------------------------------------------------------------
<table>
<tr>
<td class="label">Username:</td>
<td><input type="text" name="u_name" maxlength="16" value=""></td>
</tr>
<tr>
<td class="label">Password:</td>
<td><input type="password" name="p_word"></td>
</tr>
<tr>
<td></td>
<td class="submitIt"><button type="submit"
class="btSubmit0">Login</button></td>
</tr>
<tr>
<td colspan="2"><a href="
http://account.fotolog.com/
forgot_password">Forgot your password?</a></td>
</tr>
</table>
---------------------------------------------------------------------------------------------
I need to automate the typing in user name and password, followed by
clicking on login button.
I have tried following sets of codes, but it didn't work.
1. Accessing text type fields using aftertext attribute
$ie.text_field(:aftertext,/Username:/).set("user1")
$ie.text_field(:aftertext,/Password:/).set("pwd1")
$ie.button(:text,"Login").click
2. Accessing text fields using name attribute
$ie.text_field(:name,"u_name").set("user1")
$ie.text_field(:name,"p_word").set("pwd1")
$ie.button(:text,"Login").click
Am getting following error:
============================================================
WIN32OLERuntimeError: focus
OLE error code:800A083E in htmlfile
Can't move focus to the control because it is invisible, not
enabled, or o
f a type that does not accept the focus.
HRESULT error code:0x80020009
Exception occurred.
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/
input_elements.rb:334:in
`method_missing'
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.6/./watir/
input_elements.rb:334:in
`set'
C:/natasha/RubyScripts/FinalAutomatedTests/minicard_fotolog.rb:
54:in `test_a
_orderPlacement'
============================================================
Thanks and regards,
Natasha